How to Convert Days(Text field) into Date By giving the start date

  • Thread starter Thread starter FA
  • Start date Start date
F

FA

Hi Freinds

I am really having problem with this issue, if there is anyone out
there help a freind..

I have a Form that has Start Date, End Date, Number of Days.
I want to be able to just input the Start date and Number of days and
it give me the End Date with regular 5days a week scheduel.


Can some help me pleaseeeeeeeeeeeeeeeeeee


Moe
 
I suppose in the after update event of the Number Of days text box, you
could go:


me.txtEndDate = MyDateAdd(me.txtStartDate,me.txtNumDays)



And, in a public module, you put:

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 txtNumDays (Text Box) can be associated with TesterVacationDates
so when it calculate the enddate, it subtract the TesterVacationDates
and give me the Enddate.

If possible please solve this issue, i would really really appreciate
it.

Moe
 
Back
Top