Conditional formatting multiple values & DOB (1 Viewer)

KET

New member
Local time
Today, 08:52
Joined
May 15, 2020
Messages
2
Hello,

I wonder if you could help me please. (Please bear in mind I am very new to access and I'm trying my best to learn but I'm not there yet).

I have a form set up and I want to conditional format one field to highlight red. I can do this for one value i.e highlight red when text says 'Undecided Assessment'. But I would like the field to highlight red if the field is 'Undecided Assessment' or 'GB' or 'EU'. Do I need to do this as an expression? I tried setting up three rules and it didn't work?


The other thing I would like to do if possible is using the date of birth work out if a person will be under 18 on the 1st October of each year. So for the data in the current database I would like to know all the people who will be under 18 years old on the 1st October 2020 and highlight them red. Is this possible with conditional formatting? Would this also be an expression?

If possible please can you give me something to cut and paste in! Thank you
 

theDBguy

I’m here to help
Staff member
Local time
Today, 00:52
Joined
Oct 29, 2018
Messages
13,678
Hi. Welcome to AWF!

For your first question, creating three (3) rules should have work. But, using a single expression should do the job as well. For your DOB question, yes, you will need an expression for that because you want to calculate the age by October of this year. An example of expression for the first question might look something like this:

Expression Is: [FieldName] In("Undecided Assessment","GB","EU")

Hope that helps...
 

KET

New member
Local time
Today, 08:52
Joined
May 15, 2020
Messages
2
Thank you the DBguy the multiple highlighting has worked.Phew one down just the DOB query to go!
 

theDBguy

I’m here to help
Staff member
Local time
Today, 00:52
Joined
Oct 29, 2018
Messages
13,678
Thank you the DBguy the multiple highlighting has worked.Phew one down just the DOB query to go!
Glad to hear it. The DOB calculation could get a little tricky using an expression. It might be simpler to use a custom function for it. In any case, maybe you could try this:

Expression Is: DateDiff("yyyy",[DOB],Date()) + (Month([DOB])<=10) >= 18

(untested)
Hope that helps...
 

Users who are viewing this thread

Top Bottom