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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error 2501 when Email Cancelled

Status
Not open for further replies.

firebirdta84

Technical User
Aug 23, 2007
56
US
I have a form with a button that, when pressed, will open MS Outlook and attach a query from the database in XLS format. It works perfectly, but if I click the button and then decide I don't want to send the email and close out of the email, I get Run-time error 2501: The SendObject action was cancelled. Here's the code for the button:

DoCmd.SendObject acSendQuery, "qry_Master", acFormatXLS, "joe123@yahoo.com", , , "Daily Update"

Any help would be appreciated!
 
Simply use an error handler routine ...

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top