[/QUOTE]
Public Function GlblErrMsg( _
[QUOTE="GPGeorge, post: 1965887, member: 22584"]
Optional ByVal iLn As Integer, _
Optional ByVal sFrm As String, _
Optional ByVal sCtl As String) As Boolean
Dim appc As Appconstants
Dim strErrMessage As String
Dim strSupport As String
Dim errNum As Long
Dim strErrDesc As String
Dim intLN As Long
If Err.Number = AppErr.actioncancelled Then Exit Function
errNum = Nz(Err.Number, 9999)
strErrDesc = IIf(Len(Err.description & "") = 0, " Unidentified Error", Err.description)
intLN = IIf(Len(Erl & "") = 0, 0, Erl)
sCtl = IIf(Len(sCtl & "") = 0, " Unidentified Procedure", sCtl)
sFrm = IIf(Len(sFrm & "") = 0, " Environment", sFrm)
Set appc = New_AppConstants
GlblErrMsg = False
strSupport = Replace(appc.SupportEmail, ",", vbNewLine)
strMBTitle = appc.MBErr
lngMBBtn = appc.MBYNBtn
strErrMessage = "Please report this error to Your Support Person: " & appc.SupportPerson & "." & strDoubleLine & _
"The Error Number was: """ & errNum & """." & strSingleLine & _
"The Error Description was: """ & Nz(strErrDesc, " No Description") & """." & strDoubleLine & _
"The error occurred at Line Number: " & intLN & strSingleLine & _
"In procedure: """ & sCtl & """." & strSingleLine & _
"In module: """ & sFrm & """." & strDoubleLine & _
"Please submit this error report " & _
"and a brief description " & "of what you were doing when the error occurred." & strDoubleLine
On Error Resume Next
GlblErrMsg = True
If MsgBox(Prompt:=strErrMessage & vbCrLf & vbCrLf & "Send report?", buttons:=lngMBBtn, Title:=strMBTitle & " Send Report?") = vbYes Then
DoCmd.SendObject objecttype:=acSendNoObject, To:=strSupport, Subject:="Error Occurred in " & appc.AppName, messagetext:=strErrMessage, templatefile:=False
Else
If Nz(appc.booDebug) Then Stop
End If
End Function