Here is a function that does just that. You will need a holiday table that
has each holiday in it. You can create one with the names in the code or if
you choose to use different names, change the code:
'---------------------------------------------------------------------------------------
' Procedure : CalcWorkDays
' DateTime : 5/8/2006 16:34
' Author : Dave Hargis
' Purpose : Counts the number of days between two dates excluding Saturdays,
' : Sundays, and any days in the Holidays table
'---------------------------------------------------------------------------------------
'
Function CalcWorkDays(dtmStart As Date, dtmEnd As Date) As Integer
On Error GoTo CalcWorkDays_Error
'Calculates the number of days between the dates
'Add one so all days are included
CalcWorkDays = DateDiff("d", dtmStart, dtmEnd) - _
(DateDiff("ww", dtmStart, dtmEnd, 7) + _
DateDiff("ww", dtmStart, dtmEnd, 1)) + 1
'Subtract the Holidays
CalcWorkDays = CalcWorkDays - DCount("*", "holidays", "[holdate] between
#" _
& dtmStart & "# And #" & dtmEnd & "#")
CalcWorkDays_Exit:
On Error Resume Next
Exit Function
CalcWorkDays_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & _
") in procedure CalcWorkDays of Module modDateFunctions"
GoTo CalcWorkDays_Exit
End Function

Signature
Dave Hargis, Microsoft Access MVP
> Records BD TargetDate
> 1 10 10/22/07
[quoted text clipped - 21 lines]
> Thanks
> Al
Al - 09 Oct 2007 13:15 GMT
Thank you Klatuu, I will try it and let you know.
Al
> Here is a function that does just that. You will need a holiday table that
> has each holiday in it. You can create one with the names in the code or if
[quoted text clipped - 60 lines]
> > Thanks
> > Al
Al - 11 Oct 2007 18:56 GMT
Hi Klatuu,
I tried it and it works nice. However, I still need to recalculate all the
dates from the changed BD number on. any idea?
thanks
Al
> Here is a function that does just that. You will need a holiday table that
> has each holiday in it. You can create one with the names in the code or if
[quoted text clipped - 60 lines]
> > Thanks
> > Al