G
Guest
Hello,
I have a form with a start and a finish time (2 text boxs), and another text
box call WAITING_TIME that calculates the difference. I'm trying to execute
some code if that waiting time is less than one minute.
I've tried to use this code in the After Update event of the finish time:
If DateDiff("n", Me.START_TIME, Me.FINISH_TIME) <= #12:01:00 AM# Then
Do While Len(Me.OBSERVATIONS.Value) = 0
MsgBox "The processing time is unusually short. Please enter notes
exaplining the reason ", , "Short Process Time"
Me.OBSERVATIONS.SetFocus
Loop
End If
I've tried changing the #12:00:01 AM# with a "1" (since datediff calculates
the difference in minutes)
I have also tried using the WAITING_TIME value instead of the datediff
function:
If Me.WAITING_TIME <= #12:01:00 AM# Then...
Also tried
If Me.WAITING_TIME <= 0.000694444444444444 Then...
(0.000694444444444444 is the numeric equivalent of 1 minute, at least in
Excel)
Does anybody have an idea of why this If statement is not triggered when
that wait time is less than one minute?
Thanks!
I have a form with a start and a finish time (2 text boxs), and another text
box call WAITING_TIME that calculates the difference. I'm trying to execute
some code if that waiting time is less than one minute.
I've tried to use this code in the After Update event of the finish time:
If DateDiff("n", Me.START_TIME, Me.FINISH_TIME) <= #12:01:00 AM# Then
Do While Len(Me.OBSERVATIONS.Value) = 0
MsgBox "The processing time is unusually short. Please enter notes
exaplining the reason ", , "Short Process Time"
Me.OBSERVATIONS.SetFocus
Loop
End If
I've tried changing the #12:00:01 AM# with a "1" (since datediff calculates
the difference in minutes)
I have also tried using the WAITING_TIME value instead of the datediff
function:
If Me.WAITING_TIME <= #12:01:00 AM# Then...
Also tried
If Me.WAITING_TIME <= 0.000694444444444444 Then...
(0.000694444444444444 is the numeric equivalent of 1 minute, at least in
Excel)
Does anybody have an idea of why this If statement is not triggered when
that wait time is less than one minute?
Thanks!