Public Function RoundTime(ByVal dTime As Date) As Date
Dim min As String
Dim rnd As Integer
Dim add As Double
min = DatePart("n", dTime)
rnd = Right(min, 1)
add = 0
Select Case rnd
Case 0, 5: add = 0
Case 1, 6: add = -1
Case 2, 7: add = -2
Case 3, 8: add = 2
Case 4, 9: add = 1
End Select
RoundTime = DateAdd("n", add, dTime)
End Function