Control formating

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like the color of the control to change if the user has there cursor
in it. How can I do that?
 
Isn't there some way to make this happen throught the whole database with
having to program each control?
 
You don't actually need to program each control.

Create a couple of public functions along the lines of

Function HighlightControl()
Screen.ActiveControl.BackColor = vbRed
End Function

Function RemoveHighlight()
Screen.ActiveControl.BackColor = vbWhite
End Function

Go to your form(s) and select each control for which you want to control the
highlighting (you can select multiple by "roping" them, or clicking on them
one at a time while holding down the shift key).

With the controls selected, go to the Properties sheet and set the On Got
Focus property to "=HighlightControl()" (no quotes, but you need the = in
front and the parentheses at the end). Set the On Lost Focus to
"=RemoveHighlight()"
 
Back
Top