Results 1 to 6 of 6
  1. #1
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Jerusalem, Israel
    Posts
    708
    Thanks
    0
    Thanked 1 Time in 1 Post

    Hidden Form (2K/XP)

    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

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Hidden Form (2K/XP)

    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.
    Charlotte

  3. #3
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Jerusalem, Israel
    Posts
    708
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Hidden Form (2K/XP)

    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("

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Hidden Form (2K/XP)

    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? <img src=/S/confused.gif border=0 alt=confused width=15 height=20> 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.
    Charlotte

  5. #5
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Hidden Form (2K/XP)

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

  6. #6
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Jerusalem, Israel
    Posts
    708
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Hidden Form (2K/XP)

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •