View Full Version : Who opened me?


johndoh!!
03-05-2002, 09:03 AM
I have three forms (Orders, OrdersNew and OrdersSub). Both Orders and OrdersNew have a button that opens OrdersSub, how do i detect whithin OrdersSub the form that opened it?

Fornatian
03-05-2002, 10:17 AM
Use the OpenArgs of the docmd.openform method to pass a value to the form.

In the OnLoad event use an argument to take appropriate action suchas:

If Me.OpenArgs = "Opened from form1" then
Msgbox "Form1 Originated"
Else
Msgbox "Form2 Originated"
End If

HTH

Ian

johndoh!!
03-05-2002, 11:08 AM
Thanks Fornatian it worked great!!

I appreciate your taking the time to help!!