G
Guest
Hi,
I made a form where the fields change color on focus. It worked fine during
construction, but when the form is closed and re-opened a Runtime error 2474,
"The expression you entered requires the control to be in the active window."
When I hit the debug option, it highlights the second line of this code:
Private Sub txtCertNo_GotFocus()
Screen.ActiveControl.BackColor = RGB(0, 255, 255)
End Sub
I've tried, in the form properties OnCurrent, writing Me!txtCertNo.SetFocus,
but it doesn't work--saying Can't find the macro 'Me!txtCertNo.SetFocus'
Trying in the same OnCurrent area: =Me!txtCertNo.SetFocus doesn't work, and
neither does writing in the code:
Private Sub Form_Current()
Me!txtCertNo.SetFocus
End Sub
Please advise & thank you for your time!
Karl
I made a form where the fields change color on focus. It worked fine during
construction, but when the form is closed and re-opened a Runtime error 2474,
"The expression you entered requires the control to be in the active window."
When I hit the debug option, it highlights the second line of this code:
Private Sub txtCertNo_GotFocus()
Screen.ActiveControl.BackColor = RGB(0, 255, 255)
End Sub
I've tried, in the form properties OnCurrent, writing Me!txtCertNo.SetFocus,
but it doesn't work--saying Can't find the macro 'Me!txtCertNo.SetFocus'
Trying in the same OnCurrent area: =Me!txtCertNo.SetFocus doesn't work, and
neither does writing in the code:
Private Sub Form_Current()
Me!txtCertNo.SetFocus
End Sub
Please advise & thank you for your time!
Karl