Results 1 to 4 of 4

Thread: Microsoft Access - Calculating Due Date excluding holidays and weekends

  1. #1
    Join Date
    Dec 2010
    Posts
    1

    Microsoft Access - Calculating Due Date excluding holidays and weekends

    We have a database form where we identify when a document that has been submitted is due. Currently, the database form calculates the number of turnaround days based on the length of the document submitted. I need to take it to the next step which is to have it add the number of turnaround days to the date received to arrive at the due date - but I need to exclude holidays and weekends. It's taken all I could do to get this far, but haven't found anything that seems to help in this case. I know nothing about VB. Appreciate your suggestions.

  2. #2
    Join Date
    Mar 2006
    Location
    Oklahoma City, OK
    Posts
    184
    Quote Originally Posted by zahr03 View Post
    We have a database form where we identify when a document that has been submitted is due. Currently, the database form calculates the number of turnaround days based on the length of the document submitted. I need to take it to the next step which is to have it add the number of turnaround days to the date received to arrive at the due date - but I need to exclude holidays and weekends. It's taken all I could do to get this far, but haven't found anything that seems to help in this case. I know nothing about VB. Appreciate your suggestions.
    I would recommend this code:
    NetWorkdays and fAddWorkDays ...

    It is really easy to use.

    1) create the table tblHolidays with a field named HolidayDate that is data type date/time. This will hold a list dates to skips other than weekends.

    2) copy and paste the code onto a new code module. Name the module modWorkdays

    Now you are ready to use the functions.

    Similar to using the DateAdd() fucntion you will use fAddWorkdays.
    Boyd Trimmell aka HiTech Coach
    Microsoft MVP - Access Expert
    [SIGPIC][/SIGPIC]
    Office Programming 25+ years as a Software Developer specializing in:
    Business Process Management
    Accounting/Inventory Control
    Customer Relations Management (CRM)
    Electronic Data Interchange (EDI)

  3. #3
    Join Date
    Jun 2012
    Posts
    1
    thanks Hitechcoach, i followed your instructions and now receive the error "run time error 3061. too few parameters. expected 1" with the code line "With CurrentDb.OpenRecordset(strSQL, dbOpenSnapshot)" in the fnetworkdays function. any helpful hints on this error? thanks!

  4. #4
    Join Date
    Mar 2006
    Location
    Oklahoma City, OK
    Posts
    184
    This table tblHolidays is used to hold a list of all the holidays ypu want to avoid


    Did you create the table tblHolidays?
    Does your table tblHolidays have a field named HolidayDate?
    Boyd Trimmell aka HiTech Coach
    Microsoft MVP - Access Expert
    [SIGPIC][/SIGPIC]
    Office Programming 25+ years as a Software Developer specializing in:
    Business Process Management
    Accounting/Inventory Control
    Customer Relations Management (CRM)
    Electronic Data Interchange (EDI)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •