How do I change the colour of a text box at runtime?

A

Ascorpius

I would like to change the background colour of a text box depending upon the
data displayed. EG if the data = HIGH background is red. If data = LOW
background is green. I can do this in VB but it applies to all forms in
continuous forms setting. I want it specific to an individual form in a list
of continuous forms.
 
F

fredg

I would like to change the background colour of a text box depending upon the
data displayed. EG if the data = HIGH background is red. If data = LOW
background is green. I can do this in VB but it applies to all forms in
continuous forms setting. I want it specific to an individual form in a list
of continuous forms.

Your use of terminology is confusing. I suspect you mean...
..... but it applies to all records in continuous forms setting. I want
it specific to an individual record in a list of continuous records.

If so, then you will have to use the control's Conditional Formatting
property.

In Form design view, select the control, then click on Format +
Continuous Formatting.
Set Condition1 to Field Value Is
Select equal to in the next box and enter "High" (with the quotes) in
the next box.
Click Add.
Then set Condition2 the same as above, except write "Low" as the equal
to value. Set the color to Green.
Save the change.
 

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

Top