Select Case with Time

George Too

Registered User.
Local time
Yesterday, 22:18
Joined
Aug 12, 2002
Messages
198
Hello All,
I am trying to build a Select Case rutine where something happens if the time field is betweeb a given time slot. This does not seem to work:

Dim varTime As String
varTime = Format(Now, "h:mm:ss AMPM")

Select Case varTime
Case Is > #11:59:00 PM# And varTime < #8:00:00 AM#
MsgBox ("Case is 3rd shift.")
End Select

Can anyone tell me what's wrong with it?

Thanks,
George Too
 

Users who are viewing this thread

Back
Top Bottom