datediff / if syntax

teiben

Registered User.
Local time
Today, 16:09
Joined
Jun 20, 2002
Messages
462
I'm trying to compare a date fields (Date Quotes), to DueDate, however I need if duedate is today or late it needs to be red, of if it's within 3 days green.

THis is what I have, and it's not working right, I'm using 97

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me.DueDate < Me.DateQuoted Then
DateQuoted.ForeColor = vbRed
Else
If DateDiff("d", Me.DueDate, DateQuoted) <= 3 Then
DateQuoted.ForeColor = vbGreen
Else
DateQuoted.ForeColor = vbBlack
End If
End If


Help would be greatly appreciated
 

Users who are viewing this thread

Back
Top Bottom