View Full Version : Changing the forecolor dependent on value


REDaughdril
12-09-2002, 08:12 PM
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.

Ally
12-11-2002, 06:45 AM
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:

If Me.Expr1.Value >00:08:00 Then
Me.Expr1.ForeColor=255
Else
Me.Expr1.ForeColor=0
End If

KKilfoil
12-11-2002, 01:41 PM
If you are using Access 2000 or later, look up "conditional formatting"