Following code belongs to the first field in form B. When I open form B from
form A, ctl.Name returns the name of Form's A button which I just clicked.
How does this work? I thought when the field got focus that would be the
active control. How can I solve it so that it will return the name of the
field the code is in?
Private Sub MyFirstField_Go tFocus()
Dim ctl As Control
Set ctl = Screen.ActiveCo ntrol
InfoField = ctl.Name
End Sub
Thanks,
john
form A, ctl.Name returns the name of Form's A button which I just clicked.
How does this work? I thought when the field got focus that would be the
active control. How can I solve it so that it will return the name of the
field the code is in?
Private Sub MyFirstField_Go tFocus()
Dim ctl As Control
Set ctl = Screen.ActiveCo ntrol
InfoField = ctl.Name
End Sub
Thanks,
john
Comment