P
petera
Someone please help! I'm sending an email using
DoCmd.SendObject. When the email is generated, if you
delete the email without sending it, Access generates an
error 2501 saying The SendObject action was cancelled.
I'm trying to trap that error code, ignore it and
continue... this is the code I've generated.
Private sub Send_Email()
On Error GoTo Send_Email_Error
DoCmd.SendObject blah! blah! blah!
Send_Email_Exit:
Exit Sub
Send_Email_Error:
if err.number = 2501 then
Resume Send_Email_Exit
End Sub
once the DoCmd.SendObject is executed, and the email is
cancelled, it never recognizes the eror by going to the
Send_Email_Error paragraph...what am I doing wrong?
Thanks in advance.
DoCmd.SendObject. When the email is generated, if you
delete the email without sending it, Access generates an
error 2501 saying The SendObject action was cancelled.
I'm trying to trap that error code, ignore it and
continue... this is the code I've generated.
Private sub Send_Email()
On Error GoTo Send_Email_Error
DoCmd.SendObject blah! blah! blah!
Send_Email_Exit:
Exit Sub
Send_Email_Error:
if err.number = 2501 then
Resume Send_Email_Exit
End Sub
once the DoCmd.SendObject is executed, and the email is
cancelled, it never recognizes the eror by going to the
Send_Email_Error paragraph...what am I doing wrong?
Thanks in advance.