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!

e-mail selected form

Status
Not open for further replies.

stupiet

Programmer
Aug 21, 2001
176
US
I need to e-mail the contents of a form after a user has entered the data. The macro in Access only let's you send the form in datasheet format as an attachment, also it send all the records instead of just the selected record.

Is there a way to add just the selected form into the body of an e-mail?1 If that's not possible, can you attach just the selected form to an e-mail message?

Thanks for the help.

Tan
 
Check out the SendObject method.
Code:
DoCmd.SendObject acSendNoObject,  ,  ,  
"someone@hotmail.com" , , , "Test", strMessage, False
You can create a string (strMessage) containing the message you want to send in the body of the e-mail.

So you know,you can also refer to a control's value or a string that would contain the e-mail addresses you want the message to go to.
 
BEWARE of Sendobject - it has a serious bug that renders it virtually useless in many cases!

The bug is this: Sendobject fails silently and unpredictably if called more than once in a procedure, when there are more than about 20 chars in the message body. I recently discovered this to my immense frustration (and that of my client), after spending quite a while trying to figure out why mail wasn't going out.

Yes, that's not a typo - 20 chars! Now, THAT'S a useful email function!

There is a MSKB article on this, but I don't have it on me at the moment - searching on 'sendobject' will yield it up, however.

As far as I've been able to determine, this bug - which should be easy to fix - has not been addressed by MS. Maybe someone has up-to-date info about this?

Good luck!
 
Thanks for both of your help. I'm going to try it out now, hopefully it works!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top