Find what form opened another form

L

Luis

Hello.
I'm trying to use a form on two different forms and return data into the
form that opened it.

How do i find what form opened another form?

Thanks.

Luis
 
D

Douglas J. Steele

Access doesn't keep track of it. You'll have to pass that information to the
form (as its OpenArgs parameter).
 
U

UpRider

Luis, use something like this in the *called* form. You would think that
the active form is the one executing the code, but it's not - it's the
previous or calling form. Just what you want. Make sure you use the
Form_Open event.

Private Sub Form_Open(Cancel As Integer)
Dim frmCalling as Form
Set frmCalling = Screen.ActiveForm
MsgBox "I have been called by " & frmCalling.Name
End Sub

UpRider
 
Top