Conditional formatting based on date

El Jagang

Registered User.
Local time
Today, 12:41
Joined
Aug 21, 2015
Messages
24
I've built a database that lists the birthdays of all the employees in my directorate.

I'd like their names to be highlighted in the yellow in the report I've created when their birthday is coming up in 30 days or less. I can't seem to find a formula that will help.

For example: one person's birth date is 2-Jan-57. I'd like her name to be highlighted in yellow, but I don't how to go about it. The fact she was born in '57 is irrelevant; I just want something that calculates 30 days from today (December 22).

Any help would be appreciated.
 
In the report's 'on open' event, you could add something like
Code:
 If DateDiff("d",Now(), {her birthday}) <= 30 then
       [Reports]![{report name}]![{field name}].BackColor = VbYellow
 End if
This assumes that the birthday is a field in the same row on the report as the name field you want highlighted.
 

Users who are viewing this thread

Back
Top Bottom