Text box to change Color!

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
 
J

Jeff Boyce

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
 
A

Al Campagna

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.
 
R

Rick Brandt

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.
 
G

Guest

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.
 
G

Guest

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.
 
G

Guest

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.
 
G

Guest

Also, can the background of the dropdown list be formatted in the same
colour? Right now it's just white.
 
R

Rick Brandt

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top