Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change color based on date 1

Status
Not open for further replies.

Garridon

Programmer
Mar 2, 2000
718
US
Is there are way for me to change the color of a particular row or field to red based on a date criteria? I have a report which lists suspenses and want to have either the row or the date turn red when the suspense is overdue.

Thanks!

Linda Adams (Garridon@aol.com)
"The Importance of Being Grammarian," published in The Toastmaster, March 2001
 
Hi Linda,
Why sure! Say your date field is in the "Detail" section. In the "On Format" event of the detail section you'd do something like this:

If Me![NameOfDateField] > 2001/03/28 Then
Me![NameOfDateField].backcolor = vbRed
Else
Me![NameOfDateField].backcolor = vbGreen
End if

You can pick the colors by number if you prefer, and find the number by changing the color of a control on a form in design view, and watch its "Back Color" number change in its properties pop up dialog.

If your date field is in another section of the report, do the same but in that sections "On Format" event.

C'est Tout~That's all! Gord
ghubbell@total.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top