F
FA
Hi Freinds,
I have a form that has the followint controls.
txtTestBeginDate----- Control Source ---> Test_Begin_Date
txtTestEndDate----- Control Source ---> Test_End_Date
cboTesterName--- Control Source---> Tester_Name_ID
txtNumberofDays---Control Source --> Unbound
checkboxTask1--- Control Source --- Task1
txtTaskBeginDate ---- Control Source ---> Task_Begin_Date
txtTaskEndDate ---- Control Source ---> Task_End_Date
Now in the after update event of txtNumberofDays i have the following
Me.Test_End_Date = NumofDays(Me.txtTestBegin_Date, Me.txtNumberofDays)
NumofDays is a function that calculates the Test_End_Date based of
Me.txtTestBegin_Date, Me.txtNumberofDays, it also take out any
satuarday and sunday or any holiday)
Now i want to do something like the following:
When the checkboxTask1 is checked, i want to prepulate the
txtTaskBeginDate, and txtTaskEndDate. Since it takes only 2 days to do
Task1, and it will be constant forever, i want determine the
txtTaskBeginDate based on txtTestBeginDate and txtNumberofDays. Task1
starts from TestBeginDate and ends in 2 working days.
Here is my function that is calculating NumofDays
Public Function NumofDays(dtStart As Date, intDays As Integer)
Dim dtEnd As Date
Dim I As Integer
I = 0
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
If anybody has any suggestions or recommendations, please help me.
Thanks
Moe
I have a form that has the followint controls.
txtTestBeginDate----- Control Source ---> Test_Begin_Date
txtTestEndDate----- Control Source ---> Test_End_Date
cboTesterName--- Control Source---> Tester_Name_ID
txtNumberofDays---Control Source --> Unbound
checkboxTask1--- Control Source --- Task1
txtTaskBeginDate ---- Control Source ---> Task_Begin_Date
txtTaskEndDate ---- Control Source ---> Task_End_Date
Now in the after update event of txtNumberofDays i have the following
Me.Test_End_Date = NumofDays(Me.txtTestBegin_Date, Me.txtNumberofDays)
NumofDays is a function that calculates the Test_End_Date based of
Me.txtTestBegin_Date, Me.txtNumberofDays, it also take out any
satuarday and sunday or any holiday)
Now i want to do something like the following:
When the checkboxTask1 is checked, i want to prepulate the
txtTaskBeginDate, and txtTaskEndDate. Since it takes only 2 days to do
Task1, and it will be constant forever, i want determine the
txtTaskBeginDate based on txtTestBeginDate and txtNumberofDays. Task1
starts from TestBeginDate and ends in 2 working days.
Here is my function that is calculating NumofDays
Public Function NumofDays(dtStart As Date, intDays As Integer)
Dim dtEnd As Date
Dim I As Integer
I = 0
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
If anybody has any suggestions or recommendations, please help me.
Thanks
Moe