Retrieve ActiveControl.Name from Subform Control
Posted on 2004-10-23
Hi, I'm trying to retrieve the ActiveControl.Name from a subform control, but I recieve the following error.
"The expression you entered requires the control to be in the active window."
form = billing
subform = line_items
My code was placed in the subform's "on current" property so I should get the control name everytime I click through the records in the subform.
Private Sub Form_Current()
Dim ctlCurrentControl As Control
Dim strControlName As String
Set ctlCurrentControl = Screen.ActiveControl
strControlName = ctlCurrentControl.Name
I can't seem to figure out how to have this value returned.
Thanks for any help.