• Hidden Form (2K/XP)

    Author
    Topic
    #380746

    I have an unusual issue (I” think). I have a switchboard form that starts when my application opens. Behind it is another form that starts from code on the OnOpen event of the switchboard form and is then hidden. At that point the switchboard form is supposed to reappear. What it does in reality- is appear in design view. The only way I can get it to appear in form view, is by switching to datasheet view (which shows nothing because there is no data only command buttons) and then switching to from view. Otherwise no form!
    Any ideas or direction would be greatly appreciated.
    Tahnks

    Viewing 0 reply threads
    Author
    Replies
    • #638754

      You don’t explain how you’re hiding the form and how you are “returning” to the switchboard, so it’s impossible to answer your question. when you open another form from the Switchboard, the code launches the events of the other form then returns and continues the switchboard code. You may have some conflicting instructions in there that are causing the problem but there is no way to tell without seeing the code.

      • #638769

        If you can see anything here I appreciate it.
        This is the code on the onopen of the switchboard:

        Private Sub Form_Open(Cancel As Integer)

        Dim varYatzig As Variant
        Dim x As Variant
        Dim dtNow As Date
        Dim DtMax As Date
        Dim rst As Recordset

        On Error GoTo errrorhandler

        Set rst = New Recordset
        Set rst.ActiveConnection = CurrentProject.Connection
        rst.CursorType = adOpenKeyset
        rst.LockType = adLockOptimistic
        rst.Open (“tblyatzig”)

        dtNow = Date

        DtMax = DMax(“[dtYatzig]”, “tblyatzig”)

        If dtNow > DtMax Then

        varYatzig = InputBox(“

        • #638776

          Now I’m really confused. The Form_Open routine is running in the switchboard form, frmswtchbrd? Then why are you doing a DoCmd.OpenForm to open the form that’s already running the OnOpen event? confused Once it’s opened, you don’t have to open it again. It should come up automatically. Is there something else you haven’t explained? And what is the End doing in there? You need it in VB to unload the project but it will get you in trouble in Access/VBA.

          • #638777

            What I noticed was that the error handling is a bit confusing and there is no Exit Sub prior to the error handling.
            Pat

            • #639232

              Thanks Pat. When I was working that got lost. The issue is fixed.

    Viewing 0 reply threads
    Reply To: Hidden Form (2K/XP)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: