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

Send Object Cancellation Error!!!!

Status
Not open for further replies.

Shadez

Programmer
Jul 5, 2001
57
US
Ok I have quite a few procedures that use the SendObject command.

Heres the problem and should be quite easy for most of you. If I cancell out the Outlook window after it is opened. I get a sendobject error window popup. Is there a simple way to eliminate this?
 

Use the VB error handler to capture the error or ignore it.

Example: Capture the error and handle it in code

Sub SendMail()
On Error GoTo SendMailErr
DoCmd.SendObject acSendQuery, "qTest", , "emailaddr", , , "Test", "Another test."
Exit Sub
SendMailErr:
If Err = 2501 Then
Exit Sub
End If

' Additional error handling code here
Resume next
End Sub

Example: Ignore all errors

Sub SendMail()
On Error Resume Next
DoCmd.SendObject acSendQuery, "qTest", , "emailaddr", , , "Test", "Another test."
End Sub Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
thanks a ton for your help , that worked perfect.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top