J
James
Ok I've got a function that takes all the values in a table and calculates
the total time. The function is called AddTimes See below
Function AddTimes()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim time1 As Date
Dim time2 As Date
Dim TimeAccum As Integer
Set db = CurrentDb
Set rs = db.OpenRecordset("WebProxyLog")
rs.MoveNext
Do
rs.MovePrevious
time1 = rs!logTime
rs.MoveNext
time2 = rs!logTime
If DateDiff("n", time1, time2) < 5 Then
TimeAccum = TimeAccum + DateDiff("n", time1, time2)
End If
rs.MoveNext
Loop Until rs.EOF
AddTimes = TimeAccum
End Function
How do I make a report or form that will display this.
If I run the function with debug.print it displays the proper value so its
working, but how to i get it to work with a report or form?
Thanks
the total time. The function is called AddTimes See below
Function AddTimes()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim time1 As Date
Dim time2 As Date
Dim TimeAccum As Integer
Set db = CurrentDb
Set rs = db.OpenRecordset("WebProxyLog")
rs.MoveNext
Do
rs.MovePrevious
time1 = rs!logTime
rs.MoveNext
time2 = rs!logTime
If DateDiff("n", time1, time2) < 5 Then
TimeAccum = TimeAccum + DateDiff("n", time1, time2)
End If
rs.MoveNext
Loop Until rs.EOF
AddTimes = TimeAccum
End Function
How do I make a report or form that will display this.
If I run the function with debug.print it displays the proper value so its
working, but how to i get it to work with a report or form?
Thanks