Results 1 to 7 of 7
  1. #1
    Nadine67 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jul 2015
    Posts
    55

    First Form disappears when second form called

    Hello and thank you for any attention my post may receive.

    Windows XP
    MS Access 2007

    So when i call up two forms, the first called form disappears. I want both forms to appear on the screen at the same time.

    My module 'modDaisyChain' returns an 'Outside procedure' error for 'Me.' I understand Me is not allowed in a module, but I really do not know what i should be using in this instance.

    Any help is greatly appreciated!


    Public gstrCallingForm As String
    Const DAISY_CHAIN_ON As Boolean = False '(True for on, False for off)
    Dim mstrCallingForm As String

    gstrCallingForm = Me.Name
    Me.Visible = False


    Private Sub Form_Open(Cancel As Integer)
    On Error GoTo Err_Form_Open

    If DAISY_CHAIN_ON Then
    'set calling form
    mstrCallingForm = gstrCallingForm
    gstrCallingForm = ""
    End If



    Exit_Form_Open:
    Exit Sub

    Err_Form_Open:

    Resume Exit_Form_Open

    End Sub


    Private Sub Form_Close()
    On Error GoTo Err_Form_Close

    If DAISY_CHAIN_ON Then
    'return to calling form
    If mstrCallingForm <> "" Then
    Forms(mstrCallingForm).Visible = True
    End If
    End If

    Exit_Form_Close:
    Exit Sub

    Err_Form_Close:
    If Err = 2450 Then
    'ignore error if calling form is no longer loaded
    Resume Next
    Else

    Resume Exit_Form_Close
    Resume
    End If
    End Sub
    Last edited by Nadine67; 07-29-2015 at 05:05 PM. Reason: Spelling errors

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,923
    These two lines are not within a procedure. Compiler should error because of that. Shouldn't they be in some form Open event, maybe the calling form?

    gstrCallingForm = Me.Name
    Me.Visible = False

    DAISY_CHAIN_ON is declared as a constant with value False. It can never be True.

    Don't really understand what this code in form Open and Close events is supposed to accomplish. Where did you find this code?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,428
    So when i call up two forms, the first called form disappears. I want both forms to appear on the screen at the same time.
    In file>options>current database>Application Options -tick overlapping windows

    Unfortunately I've no idea what your code is supposed to do

  4. #4
    Nadine67 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jul 2015
    Posts
    55
    Hi there June
    I found this code online from www.experts-exchange.com I found it when i googled 'modal forms disappearing behind other modal forms'.

    Hmmmm I will scrap the code, although I still want both my forms to appear on the screen at the same time. Really have no idea how to accomplish this.



    Hi Ajax
    Thank you, but 'overlapping windows' is ticked and still no joy.

    Cheers

    Nadine

  5. #5
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,428
    In that case, one form is presumably hiding the other. Dragging the one you can see over to one side should expose the other.

    Also ensure that the form auto centre property is set to no

    You can look at using the move function to position the form exactly where you want it.

    Another option might be to have a third form with the other two forms on it as subforms

  6. #6
    Nadine67 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jul 2015
    Posts
    55
    Hi Ajax

    The thing is the database opens with a control panel where the user selects various options. And it is behind the cotrol panel the first form hides whent he second form is called.

    Perhaps a sub-form is the way to go.

    Thanks for your help and have a great day!

    Nadine

  7. #7
    Nadine67 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jul 2015
    Posts
    55
    Guess what? I had my 'control panel' pop-up property set to 'Yes'. Now that it is set to 'No' I am able to view both forms at the same time.

    Thanks June and Ajax for asking the questions you did for it allowed me to see beyond the 'I'm stumped' cloud and think about it.

    Happy days

    Nadine

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Form Filters from form called with cmdButton
    By sstiebinger in forum Forms
    Replies: 1
    Last Post: 03-31-2015, 11:37 AM
  2. Replies: 1
    Last Post: 07-29-2014, 04:58 PM
  3. Replies: 2
    Last Post: 10-31-2012, 07:52 PM
  4. Replies: 5
    Last Post: 02-05-2012, 07:58 PM
  5. Replies: 4
    Last Post: 08-16-2011, 10:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums