JMongi
Active member
- Local time
- Today, 04:27
- Joined
- Jan 6, 2021
- Messages
- 802
I have a button that is going to use DateDiff to calculate service call times.
I put a basic check in to verify that there are values in the two fields but it doesn't seem to be working as intended. I fear this is something super basic, please help.
In stepping through the code, even when I can see that there are two date values in the fields and debug.print confirms that, the code portion of the IF statemetn won't run.
I put a basic check in to verify that there are values in the two fields but it doesn't seem to be working as intended. I fear this is something super basic, please help.
Code:
Private Sub btnEndTime_Click()
Dim dt As Date
'Set the value to the current time
Me.EndTime = Now()
Debug.Print Me.StartTime
'Update the site time text box
If Me.StartTime <> Null Then
MsgBox "Updating"
dt = DateDiff("n", Me.EndTime, Me.StartTime)
Me.txtSiteTime = dt
Else
'Nothing
End If
End Sub
In stepping through the code, even when I can see that there are two date values in the fields and debug.print confirms that, the code portion of the IF statemetn won't run.