Conditional Formatting

  • Thread starter Thread starter Jason
  • Start date Start date
J

Jason

I currently have a form with a date field in it, and i
wish to be able to get it so that it shows the field in
red if it's within a month of the curent date. Any ideas?

Thnaks in advance

Jason
 
yes, in the conditional formatting use something like...

[NameOfYourFiedl] between Date()-30 and Date()+30
 
In the On Current event of your form (or another appropriate event) you
could use something like:

If Abs(DateDiff("d", Date, TextBox)) > 30 Then
TextBox.ForeColor = 255
Else: TextBox.ForeColor = 0
End If

This is using 30 days as the definition of a month. If you need some other
definition of a month (i.e. number of days in the current month) just
replace the "30" with whatever you need.

HTH
 
Back
Top