R
Renraf
I have a form with two Date fields, Start and Stop, that display as Medium
Time (e.g. 9:30 AM). I end up subtracting the difference between these times,
converting it to minutes, and comparing it to another value. The problem is
that if the user enters Start = 9:30 PM and Stop = 1:30 AM, I would like Stop
- Start = 4 hours (or 240 minutes). Instead, since the user is only entering
a time, Access is assuming they are on the same date, so the difference is
-20 hours.
How can I recognize that the Stop time is before the Start time, and add 1
day to the Stop time before doing my calculation? My thought was:
Private Sub Stop_BeforeUpdate(Cancel As Integer)
Dim NewStop As Date
If Me.Start > Me.Stop Then
NewStop = Me.Stop + 1
Me.Stop = NewStop
End If
But the line Me.Stop = NewStop doesn't work. What am I doing wrong, and how
should I go about this?
Time (e.g. 9:30 AM). I end up subtracting the difference between these times,
converting it to minutes, and comparing it to another value. The problem is
that if the user enters Start = 9:30 PM and Stop = 1:30 AM, I would like Stop
- Start = 4 hours (or 240 minutes). Instead, since the user is only entering
a time, Access is assuming they are on the same date, so the difference is
-20 hours.
How can I recognize that the Stop time is before the Start time, and add 1
day to the Stop time before doing my calculation? My thought was:
Private Sub Stop_BeforeUpdate(Cancel As Integer)
Dim NewStop As Date
If Me.Start > Me.Stop Then
NewStop = Me.Stop + 1
Me.Stop = NewStop
End If
But the line Me.Stop = NewStop doesn't work. What am I doing wrong, and how
should I go about this?