X
xeoimom
How do I highlight a date if it falls on a weekend or holiday?
xeoimom said:How do I highlight a date if it falls on a weekend or holiday?
Marshall Barton said:xeoimom said:How do I highlight a date if it falls on a weekend or holiday?
Weekends are easy. Use Conditional Formatting for the text
box. The Expression Is: option would be like:
Weekday([datetextbox], 2) > 5
OTOH, holidays are an entirely different matter. They are
different for different people, businesses and locations so
you would need at least one additional table that has a
field for your specific holiday dates. Then you could
create a function that checks to see if a date for a
person/business/location is in the table (using DLookup or
some other mechanism).
Yes, thank you so much. That works the the weekends, but would I use a If
Then Statement for the Holiday? Say I create the table with Holiday name and
Holiday date.
Marshall Barton said:xeoimom said:How do I highlight a date if it falls on a weekend or holiday?
Weekends are easy. Use Conditional Formatting for the text
box. The Expression Is: option would be like:
Weekday([datetextbox], 2) > 5
OTOH, holidays are an entirely different matter. They are
different for different people, businesses and locations so
you would need at least one additional table that has a
field for your specific holiday dates. Then you could
create a function that checks to see if a date for a
person/business/location is in the table (using DLookup or
some other mechanism).
Marshall Barton said:If your holidays are really that simple (a company I worked
for had different holidays for the offices in each state and
"floating" holidays that were different for each person),
then you could use the Expression Is: option with an
expression like:
DCount("*", "Holidays", "HolidayDate=" &
Format([datetextbox], "\#yyyy-m-d\#") > 0
--
Marsh
MVP [MS Access]
Yes, thank you so much. That works the the weekends, but would I use a If
Then Statement for the Holiday? Say I create the table with Holiday name and
Holiday date.
Marshall Barton said:xeoimom wrote:
How do I highlight a date if it falls on a weekend or holiday?
Weekends are easy. Use Conditional Formatting for the text
box. The Expression Is: option would be like:
Weekday([datetextbox], 2) > 5
OTOH, holidays are an entirely different matter. They are
different for different people, businesses and locations so
you would need at least one additional table that has a
field for your specific holiday dates. Then you could
create a function that checks to see if a date for a
person/business/location is in the table (using DLookup or
some other mechanism).
So, I created a Table named [Holidays]. The field that held the dates is
named [HolidayDate]. On the report that I'm wanting the font changed to red
if it is a holiday is named [Work Orders Due]. The field is [ScheduleComp].
So, what I did is on the Report field [ScheduledComp] I created a condition 2
that read
"DLookUp("[HolidayDate]","Holidays","[HolidayDate]=[ScheduledComp]")" I'm
not sure how this is suppose to work, but can you help?
Marshall Barton said:If your holidays are really that simple (a company I worked
for had different holidays for the offices in each state and
"floating" holidays that were different for each person),
then you could use the Expression Is: option with an
expression like:
DCount("*", "Holidays", "HolidayDate=" &
Format([datetextbox], "\#yyyy-m-d\#") > 0
Yes, thank you so much. That works the the weekends, but would I use a If
Then Statement for the Holiday? Say I create the table with Holiday name and
Holiday date.
:
xeoimom wrote:
How do I highlight a date if it falls on a weekend or holiday?
Weekends are easy. Use Conditional Formatting for the text
box. The Expression Is: option would be like:
Weekday([datetextbox], 2) > 5
OTOH, holidays are an entirely different matter. They are
different for different people, businesses and locations so
you would need at least one additional table that has a
field for your specific holiday dates. Then you could
create a function that checks to see if a date for a
person/business/location is in the table (using DLookup or
some other mechanism).
Marshall Barton said:I don't think your expression can do anything useful. Why
don't you try using something more like the one I suggested?
--
Marsh
MVP [MS Access]
So, I created a Table named [Holidays]. The field that held the dates is
named [HolidayDate]. On the report that I'm wanting the font changed to red
if it is a holiday is named [Work Orders Due]. The field is [ScheduleComp].
So, what I did is on the Report field [ScheduledComp] I created a condition 2
that read
"DLookUp("[HolidayDate]","Holidays","[HolidayDate]=[ScheduledComp]")" I'm
not sure how this is suppose to work, but can you help?
Marshall Barton said:If your holidays are really that simple (a company I worked
for had different holidays for the offices in each state and
"floating" holidays that were different for each person),
then you could use the Expression Is: option with an
expression like:
DCount("*", "Holidays", "HolidayDate=" &
Format([datetextbox], "\#yyyy-m-d\#") > 0
xeoimom wrote:
Yes, thank you so much. That works the the weekends, but would I use a If
Then Statement for the Holiday? Say I create the table with Holiday name and
Holiday date.
:
xeoimom wrote:
How do I highlight a date if it falls on a weekend or holiday?
Weekends are easy. Use Conditional Formatting for the text
box. The Expression Is: option would be like:
Weekday([datetextbox], 2) > 5
OTOH, holidays are an entirely different matter. They are
different for different people, businesses and locations so
you would need at least one additional table that has a
field for your specific holiday dates. Then you could
create a function that checks to see if a date for a
person/business/location is in the table (using DLookup or
some other mechanism).
Where do I place it? When I put that in the conditional formatting it did
nothing
Marshall Barton said:I don't think your expression can do anything useful. Why
don't you try using something more like the one I suggested?
So, I created a Table named [Holidays]. The field that held the dates is
named [HolidayDate]. On the report that I'm wanting the font changed to red
if it is a holiday is named [Work Orders Due]. The field is [ScheduleComp].
So, what I did is on the Report field [ScheduledComp] I created a condition 2
that read
"DLookUp("[HolidayDate]","Holidays","[HolidayDate]=[ScheduledComp]")" I'm
not sure how this is suppose to work, but can you help?
:
If your holidays are really that simple (a company I worked
for had different holidays for the offices in each state and
"floating" holidays that were different for each person),
then you could use the Expression Is: option with an
expression like:
DCount("*", "Holidays", "HolidayDate=" &
Format([datetextbox], "\#yyyy-m-d\#") > 0
xeoimom wrote:
Yes, thank you so much. That works the the weekends, but would I use a If
Then Statement for the Holiday? Say I create the table with Holiday name and
Holiday date.
:
xeoimom wrote:
How do I highlight a date if it falls on a weekend or holiday?
Weekends are easy. Use Conditional Formatting for the text
box. The Expression Is: option would be like:
Weekday([datetextbox], 2) > 5
OTOH, holidays are an entirely different matter. They are
different for different people, businesses and locations so
you would need at least one additional table that has a
field for your specific holiday dates. Then you could
create a function that checks to see if a date for a
person/business/location is in the table (using DLookup or
some other mechanism).