Email from Access

  • Thread starter Thread starter Simon
  • Start date Start date
S

Simon

I have some code that creates an email for me to send

DoCmd.SendObject acSendNoObject, , acFormatTXT, _
strTo, , , strSubject, strBody, True



IT loads up the the email if i decdie not to send the email and close
the email access brings up an VB erros
Run time Erros 2501

The send Object action was canceled

How do i stop this error
 
Well, in all fairness, the message is correct: you did cancel the action.
<g>

Try putting error handling into the routine that calls SendObject, and
specifically trap that error. If you're not familiar with error handling,
see what Allen Browne has at http://www.allenbrowne.com/ser-23a.html
 
Back
Top