Full Version: Condition formatting - Dates
UtterAccess Forums > Microsoft® Access > Access Date + Time
gricks
I have a hidden field in a form that calculates the current date and time. (=now())
I have a field in my database called TODODueDate. I would like to get it to format this way:
GREEN - Not due today or past due
YELLOW - Due today
RED - Past Due
TODODueDate is a Short Date formatted Date.
I have tried conditional formatting, but cannot get the right combination of date formatting to get it to work.
Any ideas?
Thanks.
freakazeud
Hi,
not sure why you need the hidden control, but...
Use conditional formatting, then use three conditions on the same control:
first:
<>Date()
second:
=Date()
Third:
>Date()
TH
Good luck
gricks
Sometimes I can't see the forest for the trees -
Thanks!
freakazeud
You're welcome.
Glad I could assist.
Good luck on future projects!
schroep
You cannot format a "field" in a table, but if you have a control on your form that is BOUND to that field, you can apply conditional formatting to that control.
Select that control and open CONDITIONAL FORMATTING.
Your DEFAULT format will be the GREEN.
Your Condition1 will be:
FIELD VALUE IS ... LESS THAN ... Date()
and will set the color to RED.
Your Condition2 will be:
FIELD VALUE IS ... EQUAL TO ... Date()
and will set the color to YELLOW.
Note that, regardless of how you have your TODODueDate FORMATTED, what matters is that it only CONTAINS date information, with no time. If any of the values in that field HAVE a time component, we will need to tweak this further.
schroep
Whoops. Freakazeud beat me while I was on the phone. thumbup.gif
think having only two conditions will be faster, though.
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.