L
LAS
When I run my report I get an "automation error" each time it tries to display this in the detail section. I've compressed and repaired the report and have removed and replaced the detail item that is failing. Google suggests much more esoteric problems than I think I'm dealing with. It displays the detail OK if I don't put it in the function.
It fails on this detail item.
=fncMinutesFormatted([ElapsedTime])
But it displays this in the group totals just fine
=fncMinutesFormatted(Sum([ElapsedTime]))
Here is the definition of ElapsedTime in the query that is fhe report's record source
ElapsedTime: fncElapsedTime([incident_time],[Incident_Return_Time])
And here are the two functions mentioned above.
Public Function fncElapsedTime(dtStart As Date, dtEnd As Date) As Integer
On Error GoTo Err_ElapsedTime
fncElapsedTime = 0
If IsNull(dtStart) Or IsNull(dtEnd) Then Exit Function
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
Public Function fncMinutesFormatted(av_Minutes As Variant) As String
On Error GoTo Err_Minutes
fncMinutesFormatted = "0"
If IsNull(av_Minutes) Then Exit Function
gv_variant = av_Minutes \ 60 'I put all these assignments in in an attempt to debug.
gv_variant = gv_variant & ":"
gv_variant = Format(av_Minutes Mod 60, "00")
gv_variant = av_Minutes \ 60 & ":" & Format(av_Minutes Mod 60, "00")
fncMinutesFormatted = gv_variant
gs_Debug = "stop"
Exit_Minutes:
Exit Function
Err_Minutes:
is_temp = "fncMinutesFormatted: " & Err.Description
MsgBox is_temp
Resume Exit_Minutes
End Function
It fails on this detail item.
=fncMinutesFormatted([ElapsedTime])
But it displays this in the group totals just fine
=fncMinutesFormatted(Sum([ElapsedTime]))
Here is the definition of ElapsedTime in the query that is fhe report's record source
ElapsedTime: fncElapsedTime([incident_time],[Incident_Return_Time])
And here are the two functions mentioned above.
Public Function fncElapsedTime(dtStart As Date, dtEnd As Date) As Integer
On Error GoTo Err_ElapsedTime
fncElapsedTime = 0
If IsNull(dtStart) Or IsNull(dtEnd) Then Exit Function
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
Public Function fncMinutesFormatted(av_Minutes As Variant) As String
On Error GoTo Err_Minutes
fncMinutesFormatted = "0"
If IsNull(av_Minutes) Then Exit Function
gv_variant = av_Minutes \ 60 'I put all these assignments in in an attempt to debug.
gv_variant = gv_variant & ":"
gv_variant = Format(av_Minutes Mod 60, "00")
gv_variant = av_Minutes \ 60 & ":" & Format(av_Minutes Mod 60, "00")
fncMinutesFormatted = gv_variant
gs_Debug = "stop"
Exit_Minutes:
Exit Function
Err_Minutes:
is_temp = "fncMinutesFormatted: " & Err.Description
MsgBox is_temp
Resume Exit_Minutes
End Function