Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditional Formatting

Status
Not open for further replies.

newestAF

Technical User
Jul 9, 2009
72
US
I know I'll kick myself for asking but I just can't figure this out. Not finding the answer searching other threads. I have a date field from a table reflected on a form. The field on the form cannot be editted. I need the background color of the box to change to red if within 30 days, yellow for 31-60 days and green for 61-90 days. I've tried using "Field Value Is" and all options in next block and the below:

[DATE]-30

Nothing I try seems to be working. Can really use some help?
 



Hi,

Do you mean that the criteria is
[tt]
<=Date()+30
[/tt]
anything less than or equal to 30 days from today ?

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
IF DateDiff("d", Now, datYourDate) < 31 Then YourControl.BackColor = whatevercolor etc.

Or if there are a lot, SELECT CASE DateDiff("d", Now, datYourDate)

get the idea?

You will need to dim datYourDate as Date and use CDate(your value) to convert it.

Cogito eggo sum – I think, therefore I am a waffle.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top