L
LAS
I want to display the elapsed time between start and end times in a report. I've written a little function (code below) and have put it in a query which is the recordsource of my report. But when I try to display this value by putting the espression in the report, I get an error message...The expression is typed incorrectly or is too complex.... What can I do to achieve my goal of displaying the elapsed time???? AND the total elapsed time???
tia
las
The item in the query that is the recordsource for my report.
ElapsedTime: fncElapsedTime([Reports]![rptTrackIStudentDetail]![Incident_Time],[Reports]![rptTrackIStudentDetail]![Incident_Return_Time])
The code that is behind "fncElapsedTime"
Public Function fncElapsedTime(dtStart As Date, dtEnd As Date) As String
On Error GoTo Err_ElapsedTime
gv_variant = DateDiff("n", dtStart, dtEnd)
fncElapsedTime = gv_variant
gs_Debug = "stop"
Exit_ElapsedTime:
Exit Function
Err_ElapsedTime:
is_temp = "fncElapsedTime: " & Err.Description
MsgBox is_temp
Resume Exit_ElapsedTime
End Function
tia
las
The item in the query that is the recordsource for my report.
ElapsedTime: fncElapsedTime([Reports]![rptTrackIStudentDetail]![Incident_Time],[Reports]![rptTrackIStudentDetail]![Incident_Return_Time])
The code that is behind "fncElapsedTime"
Public Function fncElapsedTime(dtStart As Date, dtEnd As Date) As String
On Error GoTo Err_ElapsedTime
gv_variant = DateDiff("n", dtStart, dtEnd)
fncElapsedTime = gv_variant
gs_Debug = "stop"
Exit_ElapsedTime:
Exit Function
Err_ElapsedTime:
is_temp = "fncElapsedTime: " & Err.Description
MsgBox is_temp
Resume Exit_ElapsedTime
End Function