Converting Days into Days
- From: "FA" <October.April@xxxxxxxxx>
- Date: 7 Dec 2005 08:24:06 -0800
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 number of days between
VacationBeginDate and
VacationEndDate. The number of days between VacationBeginDate and
VacationEndDate is provided by the users on TesterVacationForm.
I am using the following module to calculate the TestEndDate:
Public Function MyAdd(dtStart As Date, intDays As Integer) As Date
Dim dtEnd As Date
Dim I As Integer
Dim dtMiddle As Integer
Dim frmTesterVacation As Form_frmTesterVacation
Dim frmSystem As Form_frmSystem
Dim dbo_TESTERNME As TableDef
Dim NUMOFDAYS As Field
I = 0
dtEnd = dtStart
If intDays < 1 Then
Exit Function
End If
Do While I < intDays
If Nz(Form_frmSystem.TESTER_NME_ID) <> "" Then
dtMiddle = [Form_frmTesterVacation].NumberofDays
If dtMiddle = -1 Then
Exit Do
End If
End If
dtEnd = dtEnd + dtMiddle + 1
Select Case Weekday(dtEnd)
Case 2 To 6
' regular week day.MON - Fri..count one day
I = I + 1
End Select
Loop
MyAdd = dtEnd
End Function
If possible please solve this issue, i would really really appreciate
it.
.
- Follow-Ups:
- RE: Converting Days into Days
- From: Klatuu
- RE: Converting Days into Days
- Prev by Date: Command button to copy records
- Next by Date: Re: Is there a way to have a conditional sub sub form?
- Previous by thread: Command button to copy records
- Next by thread: RE: Converting Days into Days
- Index(es):