Override The SendOject Runtime Error

  • Thread starter Peter W via AccessMonster.com
  • 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
 
D

Daveo

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

Run-Time Error '2501' 3
reset Run Time 2501 2
Error on sending email 2
Runtime errors- OpenReport 1
SendObject and Outlook 2003 Send Error 1
Error Trapping 5
send object 2
SendObject Action Message 1

Top