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