I was out of the office yesterday and wanted to continue with this project
today. Any chance I could take a peak at the function you created? Thanks
:
I am about ready to walk out the door. I will get it to you tomorrow.
--
Dave Hargis, Microsoft Access MVP
:
I think I follow your methodology. I will give it a try. Perhaps you can
you post a sample of your function if you have the opportunity so that I may
compare if I can't get my code to work. Thnx!
:
No, it uses a DCount to count the number of holidays in the table between the
two dates.
First see if the date needs to be bumped by one.
Then calculate an ending date using the weekdays.
Then count the holidays between the dates.
Then add a day for each holiday found and check for weekends in the new dates.
--
Dave Hargis, Microsoft Access MVP
:
The hour and dateadd functions you recommeded worked like a charm. Thanks
for your help!! I had the same concern about the code and the hardcoded
holiday array. I planned on creating a table to hold the holiday dates and
read them into into the array. Is this how your function works?
:
I am not that crazy about the code on the web site. Having to add a list of
holiday dates hardcoded is not the greatest idea. That means every year you
have to modify the code and redeploy your database.
I would suggest creating a holiday table with all the holidays in it.
If you have an interest, I have a function I use for this purpose.
--
Dave Hargis, Microsoft Access MVP
:
Sorry about the link. Try this one
http://www.mvps.org/access/datetime/date0012.htm
I was not aware of these two functions. It appears that your simple code
will work. I will test and let you know. If the link above worked and you
find that your recommended code may not work for this purpose, please let me
know.
Thanks for you repsonse!!
:
The link you provided doesn't work for me, but if you want to do what you are
asking, all you need is to check the time and add a day if it is after 10 AM:
If Hour(SomeDate) >= 10 then
SomeDate = DateAdd("d",1,SomeDate)
End If
Also, be aware that this should be done prior to calculating the dates.
--
Dave Hargis, Microsoft Access MVP
:
I have a user form that has a datein and dueby text box. The datein field
populates with the current date while the dueby field is 5 business days from
datein excluding identified holidays. All this happens once the user saves a
record. I was able to get this to work using the code found at
http://www.mvps.org/access/datetime/date0012.htm. I would like to take this
a step further. I want to add a business day if the user saves a record
after a specified time (say 10:00 AM). How can I modify the code to get this
to work? Any advice is really appreciated. Thanx!