Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trap "Who Called Me" 2

Status
Not open for further replies.

edbloom

Technical User
Apr 20, 2006
9
US
How do I trap "Who called me?" It will be a form via the On_Click event. The procedure will be available from at least three different form depending on the work flow already built into the database. I am just adding a new funnction that is varied only slightly based on "Who Called Me."

Thanks, Ed
 
You can use OpenArgs to pass the name of the calling form.
 
Hi!

If you are using VBA to call the form then you can use the following:

DoCmd.OpenForm "YourForm", , , , , , Me.Name

Then, in the form that you have called you use Me.OpenArgs to get the calling form's name.

hth


Jeff Bridgham
Purdue University
Graduate School
Data Analyst
 
My bad. I failed to properly word my question.

The trap needs to be in the module. So when the procedure/function is called in the form.btnOn_Click event, I can trap and know which form the call came from.
is it frmA, frmB or frmC?

Sorry for the confusion.
 
Hi!

In your module you can use:

Dim frm As Form

Set frm = Screen.ActiveForm

Then you can get the name using frm.Name

hth


Jeff Bridgham
Purdue University
Graduate School
Data Analyst
 
public sub codeBeingCalled(strFrmName as string)
your code
end sub

from any form

private cmdBtn_Click()
call codeBeingCalled(me.name)
end sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top