Change Font and backround color based on date

smoothtracks

New member
Local time
Yesterday, 21:19
Joined
Mar 28, 2013
Messages
8
Greetings all, I am a newbie/novice at best and this is my first post; so, thanks in advance.
I would like to change the Font and background color based on dates.

-I have a text box (Training Event) on a form populated from a field (Training Dates) in a query.

- I need the font and/or the background in that text box to change to red when the date is 12 month past, yellow 11 months past, white 10 months past and green for 9 months past. :banghead:
 
Conditional Formatting is the way to go. Right click on the textbox. You will need to set three conditions to cover the range of dates for each requirement.

Date() returns the current date. Use the DateAdd() or DateDiff() functions to calculate the condition.
 
Thanks for the quick response. I am not sure how to apply you instructions. I’m OK with the most basic, but when it comes to coding, VBA :banghead:
I am very green.
 
What type of Form are we talking about; Single, Continuous or Datasheet View?

With a Single View Form, you can use code in the Form_Current event to do this, as well as Conditional Formatting.

In Continuous or Datasheet View, you must use Conditional Formatting, which could be a problem. You need four differing Formats, as well as a Default Format, and until v2010, only three Formats were allowed plus a Default.

Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom