Conditional formatting a text box (1 Viewer)

fat controller

Slightly round the bend..
Local time
Today, 01:46
Joined
Apr 14, 2011
Messages
758
I have a text box that I would like to conditionally format depending on a couple of factors, but I am struggling to work out what the expression would be to do so, not least because I am not the best at conditional formatting in Access.

I have a field [StartDate], and I would like the shading of an adjacent text box to display an amber background if today's date is between 14 and 8 days before the date contained in the [StartDate] field, and show a red background if today's date is between 7 days prior to [StartDate] through to any date that is after [StartDate], BUT if the field has something in it (ie is not null), then I would like just a normal background.
 

sneuberg

AWF VIP
Local time
Yesterday, 17:46
Joined
Oct 17, 2014
Messages
3,506
Let's say the adjacent textbox is named F1 then for the amber the rules would be something like:

Code:
[Startdate]>=Date()+8 And [StartDate]<=Date()+14 And IsNull([F1])

and for the red

Code:
[Startdate]>=Date()+1 And [StartDate]<=Date()+7 And IsNull([F1])

You can look at this function in the attached database and tweak these to get them to do what you want if I didn't get it.
 

Attachments

  • ConditionalFormatStartDate.accdb
    392 KB · Views: 134

fat controller

Slightly round the bend..
Local time
Today, 01:46
Joined
Apr 14, 2011
Messages
758
Works perfectly, thank you :)
 

Users who are viewing this thread

Top Bottom