Conditional Formatting?

new_2_prog

Registered User.
Local time
Today, 11:53
Joined
Aug 4, 2008
Messages
58
On most of my report I have used conditional formatting of fields but I don't think I can use it on these others because I need to check if ActBeginDate is null and then if so make the backcolor of JobBeginDate accordingly but this is not working.

I am using Access 2003, I do notice when I do JobBeginDate. it does not offer Backcolor so I am wondering if this is not why it is coming up and what is the way around it.

Thanks!

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim today As Date

today = Format(Now(), "Short Date")

If IsNull(Me.ActBeginDate) Then
If Me.JobBeginDate < (today - 7) Then
Me.JobBeginDate.BackColor = vbGreen
ElseIf Me.JobBeginDate = today Then
Me.JobBeginDate.BackColor = vbYellow
ElseIf Me.JobBeginDate > today Then
Me.JobBeginDate.BackColor = vbRed
End If
End If
End Sub
 
Try {expression}.IsNull property instead of the IsNull function

You can use Conditional formatting
Use the Expression Is condition to base formatting on the value in another control.

Expression Is | Me.ActBeginDate.IsNull AND Me![other field] > whatever

BTW, today can be simply expressed by Date() rather than fiddling with Now()
 
Last edited:

Users who are viewing this thread

Back
Top Bottom