Changing the forecolor dependent on value

REDaughdril

Registered User.
Local time
Today, 13:23
Joined
Jan 23, 2000
Messages
58
I have a query, that dependent on a value from an expression I need to change the forecolor, my expression is:

Expr1: Format(IIf([DispatchedTime]>[EnRouteTime],DateAdd("d",1,[EnRouteTime])-[DispatchedTime],[EnRouteTime]-[DispatchedTime]),"hh:nn:ss")

What I need is if the Expr1 is greater than 8 minutes I need it to change to a red forecolor.

Thanks for all the help.
 
You can't do this in a query, only on a control in a form or report.

Your code would be something along the lines of:

Code:
If Me.Expr1.Value >00:08:00 Then
     Me.Expr1.ForeColor=255
Else
    Me.Expr1.ForeColor=0
End If
 
If you are using Access 2000 or later, look up "conditional formatting"
 

Users who are viewing this thread

Back
Top Bottom