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

highlighting certain dates in a report.. how?

Status
Not open for further replies.

benzo1

Technical User
Jan 21, 2003
17
GB
Dear Access gurus,

I have a report that displays dates from a control source. I want to highlight dates in two colors, that represents two sets of chronologies.

Red would represent anything past the date at which the report was/is to be generated, amber for any dates that are within 3 months away from the date that the report was generated.

The control source field is called "DecomDate"

How can I go about doing this?

Thanks in advance
 
You can use the On Format event of the Detail section to set the BackColor property of the control to the desired color based on its date value. For example:
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
  If Me!DecomDate < Forms!frmReportPick!ReportDate Then
    Me!DecomDate.BackColor = 255   'Red
  ElseIf Me!DecomDate < (Forms!frmReportPick!ReportDate + 90) Then
    Me!DecomDate.BackColor = 33023 'Amber
  End If
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top