G
Gary
I am trying to calculate a due date based on fields PickUpDate and
StdTransitBusDays.
I have the following function in Module DueDate (I took this from a search
on prior posts):
Public Function MyDateAdd(PICKUPDATE As Date, StdTransitBusDays As Integer)
As Date
Dim dtEnd As Date
Dim i As Integer
i = 0
dtEnd = PICKUPDATE
If StdTransitBusDays < 1 Then
Exit Function
End If
Do While i < StdTransitBusDays
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
And I have this line (from same post) in the after update event of the
StdTransitBusDays field:
me.DueDate = My DateAdd(me.PICKUPDATE,me.StdTransitBusDays
I don't get an error, just a blank field. Did I not translate the function
correctly into my own field names? Is the function called automatically or
do I need to code that?
Thanks.
StdTransitBusDays.
I have the following function in Module DueDate (I took this from a search
on prior posts):
Public Function MyDateAdd(PICKUPDATE As Date, StdTransitBusDays As Integer)
As Date
Dim dtEnd As Date
Dim i As Integer
i = 0
dtEnd = PICKUPDATE
If StdTransitBusDays < 1 Then
Exit Function
End If
Do While i < StdTransitBusDays
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
And I have this line (from same post) in the after update event of the
StdTransitBusDays field:
me.DueDate = My DateAdd(me.PICKUPDATE,me.StdTransitBusDays
I don't get an error, just a blank field. Did I not translate the function
correctly into my own field names? Is the function called automatically or
do I need to code that?
Thanks.