Conditional formatting date color for weekends

S

Silvio

I have a control with Date formatted as follow: ddd mm/dd/yy (e.g. Wed
05/15/09). The default color I am using for this date is Blue. I would like
for the font color to turn Red if the date is a Sunday or Saturday. I suspect
that I could use conditional formatting but I am not sure how to validate the
day of the week from the conditional formatting control. Anyone has any idea?

Thank you,
Silvio
 
S

Silvio

I got it to work. Using the "Expression is" in conditional formatting, I used
the following expression: Weekday([TxDate])=1 Or Weekday([TxDate])=7
 
A

Allen Browne

Try setting up the Conditional Formatting like this:
Expression ... Weekday([MyDate]) In (1,7)
substituting your field name for MyDate.
 
S

Silvio

Thank you Allen and Allan. It works fine ...but if the form does not have any
record in it, the format does not fire up, if the form has records in it then
it work fine. So that you can understand what I have and why, I have an
unbonded MyDate control that will filter records matching that date. I have
placed this control in the heading section of a continuous form. I have two
arrows (<-- Back and Next -->) to navigate back and forth from date to date,
and then refresh the data detail overtimes the date changes. It’s really not
a big deal, but if you have a way around this so that the format applies even
if the record has no data in it, I really appreciate it.

ruralguy via AccessMonster.com said:
Weekday([YourDateField], vbMonday) > 5
...is true for Saturday and Sunday
I have a control with Date formatted as follow: ddd mm/dd/yy (e.g. Wed
05/15/09). The default color I am using for this date is Blue. I would like
for the font color to turn Red if the date is a Sunday or Saturday. I suspect
that I could use conditional formatting but I am not sure how to validate the
day of the week from the conditional formatting control. Anyone has any idea?

Thank you,
Silvio

--
RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
 
S

Silvio

The unbonded date field.

ruralguy via AccessMonster.com said:
What control are you try to change the color of?
Thank you Allen and Allan. It works fine ...but if the form does not have any
record in it, the format does not fire up, if the form has records in it then
it work fine. So that you can understand what I have and why, I have an
unbonded MyDate control that will filter records matching that date. I have
placed this control in the heading section of a continuous form. I have two
arrows (<-- Back and Next -->) to navigate back and forth from date to date,
and then refresh the data detail overtimes the date changes. It’s really not
a big deal, but if you have a way around this so that the format applies even
if the record has no data in it, I really appreciate it.
Weekday([YourDateField], vbMonday) > 5
...is true for Saturday and Sunday
[quoted text clipped - 7 lines]
Thank you,
Silvio

--
RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
 

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