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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change font color if date expired 2

Status
Not open for further replies.

royweb

Programmer
Aug 27, 2003
11
0
0
US
To indicate certain records are expired, I want to generate a report that the font color of the field would change (to red) if the date value is greater than today. Please help. Thank you.
 
You should be able to do this with conditional formatting. Check it out and come back if you have questions.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
I'm using Access 97. Is conditional formatting available in that version?
 
No, you will need to use code in the On Format event of the deatil section of your report. It would really help to know the names of your controls however, consider this code:
Code:
If Me.txtDateControl > Date Then
   Me.txtDateControl.ForeColor = vbRed
 Else
   Me.txtDateControl.ForeColor = vbBlack
End If
You would need to substitute your control name.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top