MS Access: Conditionally change the background color of a text box on a Continuous Form in Access 2003/XP/2000/97

This can be accomplished with Conditional Formatting.

To do this, open the form in design view and select the text box that you wish to conditionally format. In this example, we are selecting the Drivers_License_Expiration_Date.



Under the Format menu, select "Conditional Formatting".



Then select "Field Value Is" from the Condition1 combo box. Select "less than" from the next combo box and enter the following formula in the third field:

Now()


Next, select the formatting that you'd like to apply when this condition is met. We've chosen to change the background color to red when the Drivers_License_Expiration_Date is less than the current system date/time.

Click on the OK button.


Now, when you view your Continuous Form, the records whose Drivers_License_Expiration_Date is older than the current system date/time will display a red background.

You can apply this technique to change the forecolor of the text field as well.