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

E-mail current record

Status
Not open for further replies.

hurricane

Technical User
Dec 1, 2000
6
US
I'm a little stuck on this and would really appreciate some help if possible.

I have a form which is used to add details to a record. Once data adding is finished, I would like the user to be able to send the current record to an e-mail account using the sendobject function, or something similar. I would like to keep the text boxes that describe the data also. :)

Any ideas...

Happy New Year!

H.
 
SendObject is a member function of the DoCmd object.

You can attach code to a button on your form to open an email message, with or without an attachment, fairly simply.

First you should consider if you wish to send the form's data as a whole form or report, or just include a bit of data as the main message - I generally send such data as a report (specific for emailing) in HTML. That sorted, the rest is fairly simple.

Add a button, and attach the following code:

DoCmd.SendObject acSendReport, "objYourAttachment", acFormatHTML, strDestAddress, strCCAddress , strBCCAddress , strYourEmailTitle, strYourEmailMessage, -1, False

Each of the text strings in the above can be drawn from existing data in your form, eg the destination address can be a text field on your form, or hardcode them. The -1 permits editing the message after it is compiled and before it is sent - generally a good idea. The False at the end is for using templates for HTML attachments. You should save the data before sending (DoCmd.RunCommand acCmdSaveRecord) and make sure if you do attach an object that you have correctly filtered the data.

Hope this is helps

Cheers & happy days

SDK
 
Is there away to send such a data as a attached .pdf file? Most everyone has Acrobat Reader. And would be easier to edit and stuff like that. Is there someway to do this? Lots of our other documents are .pdf and it would make it easier to keep track of. Can this be done??

TIA

natemclain
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top