send object

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
 
R

Rick Brandt

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top