TheCleaner
Technical User
New road block. I have the report calculating the =GetElapsedTime Function. After the following the advice of many, this calculated value is NOT stored anywere (only displayed on the report). I've adjusted the function so that it displays only the values I need (omitting the "seconds", leaving "12 Hours 22 Minutes..or whatever). Now, in the footer of the report I would like for those values to be totaled. For example "4563 Hours 53 Minutes".
I've tried this;
Function GetTimeCardTotal ()
Dim db As Database, rs As Recordset
Dim totalhours As Long, totalminutes As Long
Dim days As Long, hours As Long, minutes As Long
Dim interval As Variant, j As Integer
Set db = dbengine.workspaces(0).databases(0)
Set rs = db.OpenRecordset("TimeLog by pilot"
interval = #12:00:00 AM#
While Not rs.EOF
interval = interval + rs![ElapsedTime]
rs.MoveNext
Wend
totalhours = Int(CSng(interval * 24))
totalminutes = Int(CSng(interval * 1440))
hours = totalhours Mod 24
minutes = totalminutes Mod 60
GetTimeCardTotal = totalhours &" hours and " &minutes &" minutes"
End Function
.. only to get a "too few perameters error". Obviously the report is based on a query so that I can filter what I want on the report. ANY help would be great..I'm almost Finished!!
I've tried this;
Function GetTimeCardTotal ()
Dim db As Database, rs As Recordset
Dim totalhours As Long, totalminutes As Long
Dim days As Long, hours As Long, minutes As Long
Dim interval As Variant, j As Integer
Set db = dbengine.workspaces(0).databases(0)
Set rs = db.OpenRecordset("TimeLog by pilot"
interval = #12:00:00 AM#
While Not rs.EOF
interval = interval + rs![ElapsedTime]
rs.MoveNext
Wend
totalhours = Int(CSng(interval * 24))
totalminutes = Int(CSng(interval * 1440))
hours = totalhours Mod 24
minutes = totalminutes Mod 60
GetTimeCardTotal = totalhours &" hours and " &minutes &" minutes"
End Function
.. only to get a "too few perameters error". Obviously the report is based on a query so that I can filter what I want on the report. ANY help would be great..I'm almost Finished!!