Conditional text box coloring

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a continues form based on a date add query, that displays ship dates
from now through now + 60 days. I'm trying to code one of the text boxes
(soldier's name, for example), on the forms' individual records to display as
red or green based on a check box in the record. I'm able to make the colors
change, but they change for ALL the records on the form to either red or
green, rather than individually by name. Any ideas how I can display
individual records with individual colors?

Thanks
 
I have a continues form based on a date add query, that displays ship dates
from now through now + 60 days. I'm trying to code one of the text boxes
(soldier's name, for example), on the forms' individual records to display as
red or green based on a check box in the record. I'm able to make the colors
change, but they change for ALL the records on the form to either red or
green, rather than individually by name. Any ideas how I can display
individual records with individual colors?

Thanks

The check box on the form must be bound to a check box field in the
table.

Set the [Soldier Name] control color to green.
Then set the [Soldier Name] conditional formatting to:
Condition1
Expression Is
[CheckBoxName] = -1
Set the color to Red.
Save the changes.

Note: Now() + 60 days is not a good method to use.
Now() includes a time value, so the records returned if you run the
query at 9 AM may be different than if you run the query at 4 PM
(unless, of course, that is what you want).

Use Date() instead of Now().
Exp:DateAdd("d",60,Date())
 
Back
Top