When opening a form using DoCmd I am using the OpenArgs statement already to pass data from multiple controls, but I don't want the opened form to refer to the openargs statement unless that form has been opened from a certain other form (because it could stand alone under different circumstances).
So I tried to determine which form has called the form and to do that I found thread702-88008, but I do not know where to put the Private statement in the code of that thread...the code from that thread is:
"...
private frmCalledFrom as Form
public sub SetForm (Calling as Form)
set frmCalledFrom = Calling
end sub
Assuming your calling form uses a button to call, in the OnClick event, put this code (after the form has been opened): Forms![Form A].SetForm Me
Now, when you want to reference the calling form, you can do so by using the frmCalledFrom object. To get the name, you'd use: frmCalledFrom.Name"
If there is a better way to do this, I'd appreciate it...
Thanks!!
tgikristi
So I tried to determine which form has called the form and to do that I found thread702-88008, but I do not know where to put the Private statement in the code of that thread...the code from that thread is:
"...
private frmCalledFrom as Form
public sub SetForm (Calling as Form)
set frmCalledFrom = Calling
end sub
Assuming your calling form uses a button to call, in the OnClick event, put this code (after the form has been opened): Forms![Form A].SetForm Me
Now, when you want to reference the calling form, you can do so by using the frmCalledFrom object. To get the name, you'd use: frmCalledFrom.Name"
If there is a better way to do this, I'd appreciate it...
Thanks!!
tgikristi