Text box to change Color!

  • Thread starter Thread starter Bob
  • Start date Start date
B

Bob

What conditioning Format could I use so if the cursor is in the text box it
will change Color.Thanx Bob
--







..........Jenny Vance
 
Depends on which version of Access you are using. But more recent version
have conditional formatting which would allow you to have the control change
color when the control gets the focus.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Bob,
You don't need conditional formatting for that.
Use the OnEnter event of the text control to change the backcolor, and the OnExit to
change it back.
 
Bob said:
What conditioning Format could I use so if the cursor is in the text
box it will change Color.Thanx Bob


If you make all TextBoxes have a background color that contrasts with the form
then make them all transparent the one with focus will show the contrasting
color because the transparent property is ignored for the control with focus.
That would require no code at all.
 
Clever... I'll add that to the quiver! THANKS

Rick Brandt said:
If you make all TextBoxes have a background color that contrasts with the form
then make them all transparent the one with focus will show the contrasting
color because the transparent property is ignored for the control with focus.
That would require no code at all.
 
Yes, very clever indeed.
The only problem I see with this approach is that it makes the text boxes
look inactive, the same way a greyed-out menu item is unavailable.
 
That's probably the easiest method. However, I'm interested in learning how
to use the event parameters for this, so could you please say what kind of
code is required to set the background colour? When I tried it, the VB editor
opened, but since I don't know VB I was at a loss as to what to do next.

Thanks.
 
Also, can the background of the dropdown list be formatted in the same
colour? Right now it's just white.
 
Niniel said:
Yes, very clever indeed.
The only problem I see with this approach is that it makes the text
boxes look inactive, the same way a greyed-out menu item is
unavailable.

You could place different colored rectangles behind the TextBoxes to
eliminate that problem, but with a lot of controls that might not be worth
the effort.
 
Back
Top