conditional formating

S

StuJol

im using access 2003 on windows vista. i have a form in continious form view.
each row displays an id, date, tag and reason field. once the record has been
created for 12hrs i want the background color rto turn red to alert the user.

im using the following condition on all text boxes

DateAdd("h",+12,[Date])<Now()

but isnt working, can anyone see why?? thanks
 
F

fredg

im using access 2003 on windows vista. i have a form in continious form view.
each row displays an id, date, tag and reason field. once the record has been
created for 12hrs i want the background color rto turn red to alert the user.

im using the following condition on all text boxes

DateAdd("h",+12,[Date])<Now()

but isnt working, can anyone see why?? thanks

Do you really have a field named [Date]?
Date is a reserved Access/VBA/Jet word and should not be used as a
field name.
For additional reserved words, see the Microsoft KnowledgeBase article
for your version of Access:

109312 'Reserved Words in Microsoft Access' for Access 97
209187 'ACC2000: Reserved Words in Microsoft Access'
286335 'ACC2002: Reserved Words in Microsoft Access'
321266 'ACC2002: Microsoft Jet 4.0 Reserved Words'

For an even more complete list of reserved words, see:
http://www.allenbrowne.com/AppIssueBadWord.html

Is this ConditionalFormatting you are using?
Does the field actually include a time value?

Set Condition1 to
Expression Is
As the expression write:
[DateField] <= DateAdd("h",-12,Now())
Select the color

Save the change.
 
S

StuJol

suppose it is rather silly naming a field as [date]. either way i have
renamed to [createddate]

unfortunately i still cant get conditional formating to work.

the code you surgested works ok when in a qry, returns correct results. just
cant get it to work in conditional formating....


fredg said:
im using access 2003 on windows vista. i have a form in continious form view.
each row displays an id, date, tag and reason field. once the record has been
created for 12hrs i want the background color rto turn red to alert the user.

im using the following condition on all text boxes

DateAdd("h",+12,[Date])<Now()

but isnt working, can anyone see why?? thanks

Do you really have a field named [Date]?
Date is a reserved Access/VBA/Jet word and should not be used as a
field name.
For additional reserved words, see the Microsoft KnowledgeBase article
for your version of Access:

109312 'Reserved Words in Microsoft Access' for Access 97
209187 'ACC2000: Reserved Words in Microsoft Access'
286335 'ACC2002: Reserved Words in Microsoft Access'
321266 'ACC2002: Microsoft Jet 4.0 Reserved Words'

For an even more complete list of reserved words, see:
http://www.allenbrowne.com/AppIssueBadWord.html

Is this ConditionalFormatting you are using?
Does the field actually include a time value?

Set Condition1 to
Expression Is
As the expression write:
[DateField] <= DateAdd("h",-12,Now())
Select the color

Save the change.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top