Override The SendOject Runtime Error

  • Thread starter Thread starter Peter W via AccessMonster.com
  • Start date Start date
P

Peter W via AccessMonster.com

I have an email sendobject routine that sends an email to the user. However,
if the user decides NOT to send the email, they get a runtime error 2501..
"The Sendobject action was canceled" with the END DEBUG buttons.

Is there a way to Override this system error with my own more discriptive
message and error handling if the email is not sent?

Thanks,
Peter
 
Hi Peter,

I had this problem this morning, but realised I hadn't added any error
handling to my code:

Private Sub Command2_Click()
On Error GoTo Err_Command2_Click

**YOUR CODE**

Exit_Command2_Click:
Exit Sub

Err_Command2_Click:
MsgBox Err.Description
Resume Exit_Command2_Click

End Sub

When you cancel out of sending the email, you now just get a msg box
saying "The SendObject action was cancelled".

Hope that helps,

David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

reset Run Time 2501 2
Canceling sendobject 4
Error on sending email 2
Error Trapping 5
Run-Time Error '2501' 3
SendObject and Outlook 2003 Send Error 1
MS ACCESS Send Object Error 2293 0
Email to multiple users 3

Back
Top