In response to macropod and SkipVought replies:
The following is code I found that I've used in an Access database to calculate a future date from a specified starting date. The code is attached to an on-click event procedure of a command button.
The user selects a date from a calendar control, clicks on the command button and is then asked how many days from the starting date the future date should be. The result is given after the user clicks OK. (The code can also be used for weeks or months with some small modifications.)
Private Sub Command 18_Click()
Dim FirstDate As Date 'Declare variables
Dim IntervalType As String
Dim Number As Integer
Dim Msg
IntervalType = "d" '"d" specifies days as interval
FirstDate = Calendar1
Number = INputBox ("Enter number of days to add")
Msg = "New date: " & DateAdd(IntervalType, Number,FirstDate)
MsgBox Msg
Exit_Command18_Click
End Sub
The question is: how do I adapt,modify or change the code so that weekends and specified holidays are excluded in the calculation? I'm new at this so I need all the help I can get. Thanks.