Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / February 2008

Tip: Looking for answers? Try searching our database.

Conditional Formatting- Changing Color When A Date has been Reache

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
lbjcaj - 18 Feb 2008 23:28 GMT
#1 Wrote in Access 2003, About Calibration Tools. I have a calibration date
that i would like to know in color. 30 days before it happens and also 15
days before. And past due calibration date turn let say RED. Hope would any
of you would write this? Thanks Lonnie *
Allen Browne - 19 Feb 2008 05:03 GMT
Use Conditional Formatting.

1. In design view of your form/report, click the date text box with the
mouse, and choose Conditional Formatting on the Format menu.

2. Add the conditions you need. For example, to make the control named "d"
go red if date has already passed, set Condition 1 to:
    Expression         [d] <= Date()
and choose the color you want.

3. Add other conditions (up to 3.)
For example, the expression:
   [d] < Date() - 30

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> #1 Wrote in Access 2003, About Calibration Tools. I have a calibration
> date
> that i would like to know in color. 30 days before it happens and also 15
> days before. And past due calibration date turn let say RED. Hope would
> any
> of you would write this? Thanks Lonnie *
Linq Adams - 19 Feb 2008 05:05 GMT
I think this will do what you need.Tou'll need to set the colors as you like.
For each Condition you use

Expression Is

Then enter the code for each condition, exactly as shown (the Conditional
Formatting is VERY PICKY!)

16-30 days in future

[CalibrationDate]>DateAdd("d",+15,Date()) And [CalibrationDate]<DateAdd("d",
+31,Date())

15 days in future

[CalibrationDate]>Date() And [CalibrationDate]<DateAdd("d",+16,Date())   

Overdue

[CalibrationDate]<Date()
lbjcaj - 21 Feb 2008 00:23 GMT
"lbjcaj" wrote:In design view:
field value is Between Date()-30 and Date()-15....Set Color Desired.
field value is Between Date()-15 and Date().... Set Color Desired.
field value is <or= to Date()....Set Color Desired.
Works Great.
Thanks for everyone that wrote. Have a great day.

> #1 Wrote in Access 2003, About Calibration Tools. I have a calibration date
> that i would like to know in color. 30 days before it happens and also 15
> days before. And past due calibration date turn let say RED. Hope would any
> of you would write this? Thanks Lonnie *
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.