get current object name

G

Guest

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
 
J

John Spencer

Try

Screen.ActiveControl

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
F

fredg

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top