A fellow programmer was helping me out on a formula to determine whether or not the person was entering the correct time for their shift. The problem is the time is not being looked at right(I think). Even when I put the right shift time in the fields I still get the message box "Time is wrong". The fields I'm dealing with are txtStartTime(ex: 14:00) and txtEndTime(ex:15:00), I'm using military time. Heres the code:

Enum eShift
esDay = 1
esSwing = 2
esGrave = 3
End Enum

Const dDayStart As Date = #6:30:00 AM#
Const dDayStop As Date = #3:00:00 PM#
Const dSwingStart As Date = #2:00:00 PM#
Const dSwingStop As Date = #10:30:00 PM#
Const dGraveStart As Date = #10:00:00 PM#
Const dGraveStop As Date = #6:30:00 AM#
Dim bSuccess As Boolean
Dim lShift As eShift

'get only the time from the current date/time value (now)
dTime = Format(Now(), "HH:mm")
Select Case lShift
Case esDay
' verify between times
bSuccess = (dTime >= dDayStart And dTime <= dDayStop)
Case esSwing
' verify between times
bSuccess = (dTime >= dSwingStart And dTime <= dSwingStop)
Case esGrave
' verify between times (operates differently because
' it bridges midnight)
bSuccess = (dTime >= dGraveStart Or dTime <= dGraveStop)
End Select
' check the return value
If Not bSuccess Then
MsgBox "Shift time is wrong!"
Exit Sub
txtStartTime.SetFocus
Else
Call AddRecord
End If

If anyone has any suggestions on what to do from here, they would be appreciated.

jeffro