[AccessD] Conditional Formatting

Stuart McLachlan stuart at lexacorp.com.pg
Tue Aug 13 11:09:12 CDT 2024


Multiple conditions on one field are like a Select Case.
Once a condition is satisfied, no furhter conditions are tested.

Either:
1 Change the order so that you test for ActualInsepctionDate first.
or
2. Only have two conditions and make them:
Date()>=DateAdd("d",[fldBidJobAnticipatedInspectionDate],-5) AND NOT ISDATE(...)



On 13 Aug 2024 at 7:53, Rocky Smolin wrote:

> Dear List:
> 
> Client has a requirement to show different colors in a date field (fldBidJob
> *Anticipated*InspectionDate):
> 
> 1) if today's date is within 5 days make the backcolor of fldBidJob
> *Anticipated*InspectionDate yellow,
> 
> 2) if today's date is within 3 days make the backcolor of fldBidJob
> *Anticipated*InspectionDate red,
> 
> 3) if another field (fldBidJob*Actual*InspectionDate) is a date then make
> the backcolor white (IOW, of the inspection has been done, no color in the
> anticipated inspection date)
> 
> For conditional formatting for req't. 1 I use Expression is:
>       Date()>=DateAdd("d",[fldBidJobAnticipatedInspectionDate],-5)
> Works well.
> 
> For conditional formatting for req't. 2 I use Expression is:
>       Date()>=DateAdd("d",[fldBidJobAnticipatedInspectionDate],-3)
> Also works well.
> 
> For conditional formatting for req't. 3 I use Expression is:
>       IsDate([fldBidJobActualInspectionDate])
> 
> Doesn't work. The backcolor of  fldBidJob*Anticipated*InspectionDate
> remains red when there is a date in fldBidJobActualInspectionDate.
> 
> The three conditions are stacked 1) red first, 2) yellow second, 3) white
> third.
> 
> If I have only the first two conditions they both work well.
> 
> I can't figure out why the last condition doesn't work.
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> https://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 




More information about the AccessD mailing list