Private Sub Command1_Click()
Dim dStart As Date
Dim dEnd As Date
dStart = Date & " " & #7:00:00 AM#
dEnd = DateAdd("d", 1, Date) & " " & #7:00:00 AM#
If dStart < Now And dEnd > Now Then
Print "OK"
Else
Print "Not OK"
End If
End Sub
Hope this helps. If you choose to battle wits with the witless be prepared to lose.
Sorry I used different times than you are asking for should be
Private Sub Command1_Click()
Dim dStart As Date
Dim dEnd As Date
dStart = Date & " " & #4:00:00 PM#
dEnd = DateAdd("d", 1, Date) & " " & #7:00:00 AM#
If dStart < Now And dEnd > Now Then
Print "OK"
Else
Print "Not OK"
End If
End Sub If you choose to battle wits with the witless be prepared to lose.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.