Highlighting Active Field

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

Guest

In a form, I want to have the field or label highlighted when you tab to it
for data entry. The big problem is with the check box fields. In data entry
mode, it is difficult to see what field you are tabbed to especially the
check boxes.

Thanks
Don
 
DonElston said:
In a form, I want to have the field or label highlighted when you tab to it
for data entry. The big problem is with the check box fields. In data entry
mode, it is difficult to see what field you are tabbed to especially the
check boxes.

For other controls you can use a non-code method. Set all controls background
to a color that contrasts with the form's background and then set them to
Transparent. The Transparent property is ignored for the control with focus so
it will automatically stand out. If you don't like the look of the other
controls being transparent you can position a different colored box behind them.

For CheckBoxes I usually use the GotFocus event to change the BackColor of their
label and the LostFocus event to change it back.
 
Rick,

Got it to work on the text fields with no problem, thanks. Having a problem
with the GOTFOCUS part of it. I am having a problem coding the event
procedure. Any help would be appreciated. Field name is TYPEBLS and is a
Y/n check box. I cannot get the label or field to change color.
 
DonElston said:
Rick,

Got it to work on the text fields with no problem, thanks. Having a problem
with the GOTFOCUS part of it. I am having a problem coding the event
procedure. Any help would be appreciated. Field name is TYPEBLS and is a
Y/n check box. I cannot get the label or field to change color.

If you do the same thing with the label (set BackColor to contrasting color and
set to Transparent) then...

Private Sub CheckBoxName_GotFocus()
Me.CheckBoxLabelName.BackStyle = 1
End Sub

Private Sub CheckBoxName_LostFocus()
Me.CheckBoxLabelName.BackStyle = 0
End Sub
 
Back
Top