Count 10 Business Days from xx

AccessNub

Registered User.
Local time
Today, 01:13
Joined
Jul 22, 2006
Messages
71
I have seen a few modules that let you count how many business days between two dates. What I am looking for is how to count 10 business days from another field.

Say for example I have a txt box that auto populates =Date(). I want to have another txt box that will count 10 business days ahead and put that date in the box.

This is so I can have the db show a due date for reports sent in.

Anyone seen/done/have code for this?
 
Code:
Public Function PlusWorkdays(dteStart As Date, intNumDays As Long) As Date

PlusWorkdays = dteStart
Do While intNumDays > 0
     PlusWorkdays = DateAdd("d", 1, PlusWorkdays)
     If Weekday(PlusWorkdays, vbMonday) <= 5 Then
'-- If you have a Holiday Table use the next IF instead!
'     If Weekday(PlusWorkdays, vbMonday) <= 5 And _
      IsNull(DLookup("[Holiday]", "tblHolidays", _
      "[HolDate] = " & Format(PlusWorkdays, "\#mm\/dd\/yyyy\#;;;\N\u\l\l"))) Then
      '-- The above Format of PlusWorkdays works with US or UK dates!
          intNumDays = intNumDays - 1
     End If
Loop
End Function
 
Woot, I played with this today at work, works perfectly.

Thank you
 

Users who are viewing this thread

Back
Top Bottom