Email current recordset as PDF in a access form

I have this form called AVR and I wanted to add a button called  (EMAIL ENGINEERING) to select for the engineer name from tbl_ENGINEER_NAME to send the current record set as a pdf.

See attachment....
--ana-file-01-wfp-users-lfreund-TO.accdb
LUIS FREUNDAsked:
Who is Participating?
 
MAS (MVE)EE Solution GuideCommented:
Hi LUIS FREUND,
I suggest create a report as per your rquirement and use this code and send that report as attachment.
Please check this. I am not at desk to create all these. I have limited access now. Please check the codes and make changes according to the notes.

Thanks
MAS
--ana-file-01-wfp-users-lfreund-TO.accdb
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
As indicated, you should create a report, but the attachment by MAS doesn't seem to show code how to do that, or how to email a report.

You can send a report as an Email like this:

DoCmd.OpenReport acSendReport, 'Your Report Name", acFormatPDF, "janedoe@doe.com", , , "Your Subject", "Your Body", True

Here's more information about the Sendobject command: https://msdn.microsoft.com/en-us/vba/access-vba/articles/docmd-sendobject-method-access
0
 
mbizupCommented:
No points please - I think the DoCmd.OpenReport in Scott's comment above is a typo.  It should be DoCmd.SendObject, as in his MSDN link.
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Thanks Miriam - that was a typo!
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
The correct way to do this is to create a report, and MAS suggested this, along with a sample file. My comment provided additional commentary and links to relevant material.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.