Code:
Turn Red if the value is within 30 days of the ubound date
What do you mean "the value"?
You need two date controls. One is the unbound text box, what is the other date control??
Lets say you have a form bound to a table.
The table has a date field "NextReading".
The form is set to continuous forms view.
In the header is the unbound text box named "Text47".
In the details section is a text box control bound to the field "NextReading". The control is named "tbNextReading". (tb for text box)
To set up conditional formatting, you would click on the "tbNextReading" and open the conditional formatting dialog box.
Add a new rule
Field value BETWEEN [Text47]+31 and [Text47]+60
Then click on the bucket (background color) and select Orange.
Click on OK
Click on New Rule
Field value LESS THAN [Text47]+30
click on the bucket (background color) and select Red.
Click on OK
Click on New Rule
Field value GREATER THAN [Text47]+61
click on the bucket (background color) and select Green.
Click on OK
Click on OK
NOTE: the name of the text box in the form header MUST be enclosed in brackets, as in: [Text1]
NOTE 2: the format for the unbound text box in the header must be "Short Date". (Open the properties, click on the FORMAT tab\ FORMAT property)
Enter a date into the unbound text box Text47 in the header .
Change the date to see if the BG colors change.