G
Guest
Hi,
I have a form that is designed to have fields change color on "gotfocus."
This was done with this code:
Private Sub txtCertNo_GotFocus()
Screen.ActiveControl.BackColor = RGB(0, 255, 255)
End Sub
It goes back to white on lostfocus.
It works fine until the form is closed and reopened. Then I get a runtime
error msg # 2474 that says "The expression you entered requires the control
to be in the active window"
Going to debug, the 2nd line of the above code is highlighted.
Looking @ other potenial solutions...Oncurrent for form =
Me!txtCertNo.SetFocus does not work. When I end the debug, the cursor is in
the 1st tab order box, which is txtCertNo, but it is with a white background,
rather than cyan.
Please advise & thank you!
Karl
I have a form that is designed to have fields change color on "gotfocus."
This was done with this code:
Private Sub txtCertNo_GotFocus()
Screen.ActiveControl.BackColor = RGB(0, 255, 255)
End Sub
It goes back to white on lostfocus.
It works fine until the form is closed and reopened. Then I get a runtime
error msg # 2474 that says "The expression you entered requires the control
to be in the active window"
Going to debug, the 2nd line of the above code is highlighted.
Looking @ other potenial solutions...Oncurrent for form =
Me!txtCertNo.SetFocus does not work. When I end the debug, the cursor is in
the 1st tab order box, which is txtCertNo, but it is with a white background,
rather than cyan.
Please advise & thank you!
Karl