J
Jamie S. Schaller
I have the following code listed below. Can anyone explain why I still get
the error message 2501, even though I have code to trap that error?
Private Sub cmdEmail_Click()
Dim strSQL As String
On Error GoTo Err_Handler
strSQL = "procRpt_ChangeRequest " & mintSourceType & ", " & mlngChangeID
'Process the pass-through query
Call PassThroughFixup("rpt_qrysptChangeRequest", strSQL,
strConnect:=Forms!frmLogin.ODBCConnect)
'Attach the report as a snapshot file to an email
DoCmd.SendObject acSendReport, "rptChangeRequest", acFormatSNP, , , ,
"Change Request #" & txtChangeNo.Value, "Attached please find a copy of the
change request.", True
Exit Sub
Err_Handler:
'If the user cancels the email message trap the error (#2501) and treat
'error like it does not exist
If Err.Number = 2501 Then
Exit Sub
Else
MsgBox Err.Number & " " & Err.Description
Exit Sub
End If
End Sub
the error message 2501, even though I have code to trap that error?
Private Sub cmdEmail_Click()
Dim strSQL As String
On Error GoTo Err_Handler
strSQL = "procRpt_ChangeRequest " & mintSourceType & ", " & mlngChangeID
'Process the pass-through query
Call PassThroughFixup("rpt_qrysptChangeRequest", strSQL,
strConnect:=Forms!frmLogin.ODBCConnect)
'Attach the report as a snapshot file to an email
DoCmd.SendObject acSendReport, "rptChangeRequest", acFormatSNP, , , ,
"Change Request #" & txtChangeNo.Value, "Attached please find a copy of the
change request.", True
Exit Sub
Err_Handler:
'If the user cancels the email message trap the error (#2501) and treat
'error like it does not exist
If Err.Number = 2501 Then
Exit Sub
Else
MsgBox Err.Number & " " & Err.Description
Exit Sub
End If
End Sub