Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

? Regarding Cancel event in module 1

Status
Not open for further replies.

3Mark3

Technical User
Nov 30, 2005
48
US
Hello all,
I'm hoping someone can help me. I have a command button, that when clicked generates an e-mail. I noticed once I create an e-mail, then decide to close it without sending it, I get the following in the database:

Run-time error '2501':

The SendObject action was canceled.


Is there any way to get rid of this run-time error? I'd prefer it if I closed the e-mail without sending it that it would not do anything. Any help is greatly appreciated, thank you!
 
Add error handling...

Sub xx()
On Error Goto ErrorHandler

Your Code

Exit sub
ErrorHandler:
Select Case err.number
Case 2501
Resume Next 'or Exit sub depending on what you mean by nothing
Case Else
msgbox "Err " & err.number & ": " & err.description
End Select
End Sub
 
Worked perfectly...thank you very much!!! This forum is great!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top