[AccessD] Conditional Formatting
Rocky Smolin
rockysmolin2 at gmail.com
Thu Aug 15 09:17:14 CDT 2024
I got it figured out. The middle condition needed to have >= AND <= in the
condition. (More than three days AND less than 5 sort of).
But I forgot that CF stops at the first condition that’s true. Thanks for
that. That CF is a really powerful feature.
As usual with Access, I just kept trying things until I got the behavior I
wanted. Reminds me of raising kids.
r
On Tue, Aug 13, 2024 at 9:33 AM Stuart McLachlan <stuart at lexacorp.com.pg>
wrote:
> You confused me initially with your order
> You numbered your conditions 1,2,3 but then say later that they are
> actaully ordered 2,1,3 :)
>
> Incidentally, this is simpler but still works:
> Date()>=[fldBidJobAnticipatedInspectionDate] - 5
> as is/does
> [fldBidJobAnticipatedInspectionDate] <= Date() + 5
>
> The latter can also be done with Field Value rather than expression and
> seems clearer to
> me
>
> 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
> >
>
>
> --
> 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