F
FA
Hi Freinds,
I have a TextBox- txtNumDays which is associated with TestStartDate and
TestEndDate. If you put Number of Days and TestStartDate, it calculates
the TestEndDate. I also have VacationBeginDate and VacationEndDate on a
different form and different table, I want the txtNumDays to calculate
the TestEndDate by Subtracting the difference of VacationBeginDate and
VacationEndDate.
I am using the following module to calculate the TestEndDate:
Public Function MyDateAdd(dtStart As Date, intDays As Integer) As Date
Dim dtEnd As Date
Dim i As Integer
i = 0
dtEnd = dtStart
If intDays < 1 Then
Exit Function
End If
Do While i < intDays
dtEnd = dtEnd + 1
Select Case Weekday(dtEnd)
Case 2 To 6
' regular week day.MON - Fri..count one day
i = i + 1
End Select
Loop
MyDateAdd = dtEnd
End Function
Also in AfterUpdate EVent of txtNumDays i have
me.txtEndDate = MyDateAdd(me.txtStartDate,me.txtNumDays)
If possible please solve this issue, i would really really appreciate
it.
I have a TextBox- txtNumDays which is associated with TestStartDate and
TestEndDate. If you put Number of Days and TestStartDate, it calculates
the TestEndDate. I also have VacationBeginDate and VacationEndDate on a
different form and different table, I want the txtNumDays to calculate
the TestEndDate by Subtracting the difference of VacationBeginDate and
VacationEndDate.
I am using the following module to calculate the TestEndDate:
Public Function MyDateAdd(dtStart As Date, intDays As Integer) As Date
Dim dtEnd As Date
Dim i As Integer
i = 0
dtEnd = dtStart
If intDays < 1 Then
Exit Function
End If
Do While i < intDays
dtEnd = dtEnd + 1
Select Case Weekday(dtEnd)
Case 2 To 6
' regular week day.MON - Fri..count one day
i = i + 1
End Select
Loop
MyDateAdd = dtEnd
End Function
Also in AfterUpdate EVent of txtNumDays i have
me.txtEndDate = MyDateAdd(me.txtStartDate,me.txtNumDays)
If possible please solve this issue, i would really really appreciate
it.