Results 1 to 3 of 3

Thread: Open form

  1. #1
    Join Date
    Mar 2004

    Unanswered: Open form

    I have a form(A) with a button that opens another form(B).
    Another form(C) has a button to open same form (B).

    I want form B to look slightly different (hide one field) depending on which form calls it. How do I know which form called form B?

  2. #2
    Join Date
    Apr 2002

    You can use IsLoaded function to determine wich form is loaded, if it is form(b) then do this do that, elseif it is form(a) then do this do that.

    If for instance you have the both (form(a) and form(b) open, you can't use the function. Instead, declare public variables to have the value of 0 and 1. When you click in form(b) to open form(c) the variable frmB=1 and frmA=0.
    In the OnOpen event of form(c), if frmB=1 and frmA=0 then .... Elseif frmB=0 and frmA=1 then.... ElseIf frmA=0 and frmB=0 then.....
    When closing the form(c) reset the values to Zero of the two variables.

  3. #3
    Join Date
    Feb 2004
    Or you can put the calling form's name in the OpenArgs portion of a DoCmd.Openform statement, then test for it in the open event of your form "B". Try a search on this forum for Openargs.

Posting Permissions

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