A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Change color on date field in form for re-certification



 
 
Thread Tools Display Modes
  #1  
Old April 12th, 2010, 04:55 AM posted to microsoft.public.access.forms
messingerjc
external usenet poster
 
Posts: 4
Default Change color on date field in form for re-certification

Hello. I have two different date fields on a form, but I would like them to
change color depending on how close to the re-certification date it is
whenever I open the form or open a report showing the same info. On each of
the date fields, I would like to have them green for anything over a month
away, yellow for anytime within a month, and red for anything expired. One
date field [PTDate] needs re-certified every 6 months, and the other date
field [WeaponDate] needs re-certified every 12 months. I've been struggling
with this for several days now and haven't been able to figure it out. Any
help on this would be greatly appreciated! Thank you in advance!
  #2  
Old April 12th, 2010, 07:39 AM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Change color on date field in form for re-certification

On Sun, 11 Apr 2010 20:55:01 -0700, messingerjc
wrote:

Hello. I have two different date fields on a form, but I would like them to
change color depending on how close to the re-certification date it is
whenever I open the form or open a report showing the same info. On each of
the date fields, I would like to have them green for anything over a month
away, yellow for anytime within a month, and red for anything expired. One
date field [PTDate] needs re-certified every 6 months, and the other date
field [WeaponDate] needs re-certified every 12 months. I've been struggling
with this for several days now and haven't been able to figure it out. Any
help on this would be greatly appreciated! Thank you in advance!


Depending on your version of Access, you should be able to use Conditional
Formatting. Use an expression such as

DateAdd("m", 5, [PTDate]) Date()

for green,

DateAdd("m", 5, [PTDate]) Date() AND DateAdd("m", 6, [PTDate]) = Date()

for yellow, and so on.
--

John W. Vinson [MVP]

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:23 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.