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!

condidtional formatting problems

Status
Not open for further replies.

billcam

Technical User
Jun 7, 2001
29
0
0
US
I am using conditional formatting to make fields change color according their value. Sometimes it works and sometimes it doesn't. I currently have a date field that I want to turn red if it is 6 months old. In the conditional formatting box, I set it to datefield-less than or equal to-date()-183. It didn't seem to work at first then it started working. I applied the exact same formatting to another date field and it would not work at all. I finally got it to work by setting it to expression-[datefield]<= date()-183.
In another form, I have a calculated field that should turn red if it is less than 140. It works fine until it drops below 100 then it changes back to black.
Seems like a simple process but I get inconsistent results.
 
Try something like this
*OnCurrent* Form Event

Datebound = Your DateField

If datebound >= DateSerial(Year(datebound), Month(datebound) + 6, Day(datebound)) Then
Me.Field = vbRed
Else
Me.Field = vbBlack
End If
-------------------------
Regards
JoaoTL
-------------------------

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top