Dates & Cond Format

I

Ickus

I have a series of records with a 'date inputted' date.
I'm now trying to do conditional formatting in a report to highlight all
records that are 3 months and older.
I'm baffled
Please help
 
J

John Spencer

Open the report in design view
Click on the control you want to use conditional formatting on
Select Conditional Formatting from the Format menu
Set Condition as
Field Value is : Less Than : DateAdd("m",-3,Date())
Select what you want for highlighting for this control.

If you are trying to highlight the entire row instead of just one control,
post back. I would usually handle that in the format event with some vba code.

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
 
K

Krzysztof Pozorek [MVP]

(...)
I have a series of records with a 'date inputted' date.
I'm now trying to do conditional formatting in a report to highlight all
records that are 3 months and older.

You do not need to use conditional formatting. Write this event procedure
instead:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If DateDiff("m", Me!DateField , Date) >= 3 Then
Me.Section(0).BackColor = RGB(255, 0, 0)
Else
Me.Section(0).BackColor = RGB(255, 255, 255)
End If
End Sub


K.P.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top