Here is a function that will check both the start and end times and if
either
falls within the specifedi range it will return True; otherwise, it will
return False:
Function CheckTimeRange(StartTime As Date, EndTime As Date) As Boolean
Const conLowRange As Date = #00:00:00#
Const conHighRange As Date = #00:70:00#
If IsBetween(StartDate, conLowRange, conHighRange) Or _
IsBetween(EndDate, conLowRange, conHighRange) Then
CheckTimeRange = True
Else
CheckTimeRange = False
End If
End Function
Here is the IsBetween function. Saves a lot of typing to use it.
Public Function IsBetween(varCheckVal As Variant, varLowVal As Variant,
varHighVal As Variant) As Boolean
IsBetween = varCheckVal >= varLowVal And varCheckVal <= varHighVal
End Function
--
Dave Hargis, Microsoft Access MVP
John said:
Hi
How can I check that time range defined by given [Start] and [End] values
has at least some of it lying in the range 00:00 to 07:00?
Thanks
Regards