Question : How can an event caller be identified

I have several Access forms with many controls.  Rather than adding/changing code in each 'click' or 'AfterUpdate' event for the controls, I would like to use a method that all the controls already call -- 'resetForm()--.  But in order to make this work, I need to identify which control has called the 'resetForm()' function.  In other words, I need to know who the event caller is.  Just as helpful would be to be able to identify the first function() in the call stack.  Any help?

Answer : How can an event caller be identified

<>

 Screen.ActiveControl and Screen.ActiveForm would help, but better yet is to pass in a reference to the actual control or form i.e.

ResetFrm(frm as Form)

 ResetFrm(Me)

As for the Procedures, there is nothing in VBA that will return the currently executing procedure.  most use a constant

Const RoutineName = "myRoutine"

JimD.

Random Solutions  
 
programming4us programming4us