what returns the current object/control name on a form?
I need to make a function call that requires the calling object name - I'd
rather make the call genertic instead of hard coding for each of the forms
controls

Signature
Jim
John Spencer - 19 Sep 2007 20:31 GMT
Try
Screen.ActiveControl

Signature
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
.
> what returns the current object/control name on a form?
>
> I need to make a function call that requires the calling object name - I'd
> rather make the call genertic instead of hard coding for each of the forms
> controls
fredg - 19 Sep 2007 20:40 GMT
> what returns the current object/control name on a form?
>
> I need to make a function call that requires the calling object name - I'd
> rather make the call genertic instead of hard coding for each of the forms
> controls
MsgBox Me.ActiveControl.Name
... or ...
MsgBox Screen.ActiveControl.Name
Also look up
MsgBox Screen.PreviousControl.Name
(in case you are clicking a command button and want the previous
control's name) in VBA help.

Signature
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail