send object

  • Thread starter Thread starter Ken Ivins
  • Start date Start date
K

Ken Ivins

I created a button to send an email to a customer using the SendObject
method and their email address on the form. This works great as long as the
email is sent. If the user changes their mind and "X's" out the email
window. Then they get a Visual basic error that the SendObject command was
canceled.

Ho do I keep them from getting this message?
I tried turning off warnings but that did not work.

Thanks,
Ken Ivins
 
Ken Ivins said:
I created a button to send an email to a customer using the SendObject
method and their email address on the form. This works great as long as the
email is sent. If the user changes their mind and "X's" out the email
window. Then they get a Visual basic error that the SendObject command was
canceled.

Ho do I keep them from getting this message?
I tried turning off warnings but that did not work.

Include an Error trap and in the trap ignore Error Number 2501.

Sub SomeSub

On Error GoTo ErrHandler

DoCmd.SendObject blah blah

Egress:
Exit Sub

ErrHandler:
Select Case Err.Number
Case 2501
'ignore
Case Else
(normal error handling code)
End Select
Resume Egress
End Sub
 
Back
Top