If you want to do this with a more complex computation, you can also do this in the form's Form_Current routine, by checking the condition and deciding whether to set the colors with black and white, or with yellow and red, or some other color scheme.
In the _Current routine,
Code:
IF DateDiff( "d", Now(), [DueDt] ) < 10 THEN
[DueDt].ForeColor = vbRed
ELSE
[DueDt].ForeColor = vbBlack
END IF
You could also do things with .BackColor and .BorderColor if you wanted. You might have to look up how to "roll your own color" with, say, the RGB function or something like that, if you don't want the "pure" colors. But heck, play with it. Also, I always get the order wrong on DateDiff, but it THINK I got that in the right order this time.
Perhaps not the best example. That is just a more complex way to do what can also be done with ConditionalFormatting.
Although ConditionalFormatting is limited to changing ForeColor and BackColor, it can also conditionally Enable a textbox, which is a really useful ability.
The big advantage of ConditionalFormatting is that it works on ContinuousForms, something that code based techniques cannot manage.
you can do it by using conditional formatting. it is quite simple. n the Conditional formatting dialog, select Cell Value Is in the first drop-down box.
Select a cell evaluator from the second drop down box. Your dialog may change and add another field.
Enter your values in the remaining text boxes.
Click the Format… button.
Choose your format options from the Font, Border and Patterns tabs.
Click OK.
Click OK or add another condition