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

canceling a Sendobject generates an error 1

Status
Not open for further replies.

JamesMcG

IS-IT--Management
Jun 16, 2000
31
IE
I am using the sendobject function to generate an e-mail. This works fine....until the e-mail is canceled, access generates an error saying the action has been canceled.<br><br>Is there any way of contoling this, the On Error wont work.<br><br>Cheers
 
Nope. That's normal<br>Don't cancel the e-mail.<br>Its just verifing that it was canceled.<br>Worry about something else.<br><br> <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.
 
I dont want people have access to my code.<br><br>When the error appears there is debug continue etc. situation.
 
Under Tools/Options/ErrorTrapping, have you selected &quot;Break on unhandled errors&quot;?
 
You can use On Error to fix this.&nbsp;&nbsp;In the module which calls the SendObject function, use On Error to branch to an errorhandler which looks similar to the following:<br><br>EMailErrorHandler:<br>&nbsp;&nbsp;&nbsp;If Err=xxx then&nbsp;&nbsp;&nbsp;'insert the correct error number in<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;place of the x's<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MsgBox (&quot;The EMail was not sent!&quot;)<br>&nbsp;&nbsp;&nbsp;Else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MsgBox Err$<br>&nbsp;&nbsp;&nbsp;end if<br>&nbsp;&nbsp;&nbsp;Exit Sub<br><br>This will give your users positive feedback about what they did.&nbsp;&nbsp;BTW, I've found that while cancelling an email from Outlook generates the error, cancelling from Outlook Express does not.<br>
 
The same thing happens to me, only access goes down totally with no possibility to debug the code. Is it possible to have access send the mail through outlook express even though outlook is the default mail client?
/Linus
 
Ryan:

Thanks. That worked like a champ.

BTW, the error code is 2501.


Larry De Laruelle
larry1de@yahoo.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top