Set color based on field value automatically

agust

Just keep moving
Local time
Today, 10:24
Joined
Sep 5, 2006
Messages
18
Is it possible (VBA programmatically) to set color automatically on each textbox in a continuous form based on field value? It means the fields / textboxes on the same column will have different colors based on their different values on different rows/records.
 
As far as I know, no

Use conditional formatting from the format menu in stead (this can be done programatically)

The reason, is that what you see, isn't multiple controls, but multiple instances of the same control - do a change to one control programatically, you change all instances of it.
 
what if you are going to have more than 3 conditional formats? for instance I have to change the back color based off of the text within the cell.

if the [Description] = "No Print Available" the backcolor needs to be Tan but i'mnew to the vb side of conditional formatting and this:

If Me!Description.Value = "Print Not Available" Then
Me!Description.BackColor = &H78BCBC
End If

returns saying that there is no value.

I have attached my database and it's under the rptCurrent
 

Attachments

Users who are viewing this thread

Back
Top Bottom