Find what form opened another form

G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top