Conditional formatting date color for weekends

  • Thread starter Thread starter Silvio
  • Start date Start date
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
 
I got it to work. Using the "Expression is" in conditional formatting, I used
the following expression: Weekday([TxDate])=1 Or Weekday([TxDate])=7
 
Try setting up the Conditional Formatting like this:
Expression ... Weekday([MyDate]) In (1,7)
substituting your field name for MyDate.
 
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
 
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
 
Back
Top