Daniel said:
I have 2 forms (A & B) which both have a button to open another form
(C). Is there a way to identify which form (A or B) was used to open
it the other form (C)?
Thank you,
Daniel
Depends on when and where you want to do it. You can have the "calling
form" (form A or B) pass its name to the "called form" (form C) via the
OpenArgs parameter of the DoCmd.OpenForm method. Or you can get the
value of Screen.ActiveForm.Name in the Open event of form C -- at this
point, C is not yet active, so the form that was active at the moment it
was opened (presumably form A or form B) will be returned by
Screen.ActiveForm. This latter method could potentially fail if some
other form grabs the focus (possibly due to a Timer event) at the moment
you open form C, but I've never seen that actually happen.