So i have this code that creates a date 12 working days from today, but i now need for it to check if the date its offering as a Bank Holiday and if so move to the next weking day.
Public Function addDays(ByVal iDays As Integer, ByVal dteStart As Date) As Date
Dim i As Integer
Dim m As Integer
m = Abs(iDays)
While m > 0
If iDays < 0 Then
dteStart = dteStart - 1
Else
dteStart = dteStart + 1
End If
If InStr(1, "sat/sun", Format$(dteStart, "ddd")) <> 0 Then
Else
m = m - 1
End If
Wend
addDays = dteStart
End Function
End Function
the above is called via form default value within date fkield as
=addDays(+12,Date())
I have all then dates in a table called "BankHolidays"
Public Function addDays(ByVal iDays As Integer, ByVal dteStart As Date) As Date
Dim i As Integer
Dim m As Integer
m = Abs(iDays)
While m > 0
If iDays < 0 Then
dteStart = dteStart - 1
Else
dteStart = dteStart + 1
End If
If InStr(1, "sat/sun", Format$(dteStart, "ddd")) <> 0 Then
Else
m = m - 1
End If
Wend
addDays = dteStart
End Function
End Function
the above is called via form default value within date fkield as
=addDays(+12,Date())
I have all then dates in a table called "BankHolidays"