Code snippet follows.
Dim v As Object
Set v = Screen.ActiveControl
Debug.Print v.Name, v.Parent.Name
Debug.Print Screen.ActiveForm.Name, Screen.ActiveForm.Caption
Beyond that it is hard to say since you didn't say where you wanted to run
the code. In a form event you can get the form name with Me.Name and the
current control with Me.ActiveControl.
--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..