oxicottin
Learning by pecking away....
- Local time
- Today, 13:28
- Joined
- Jun 26, 2007
- Messages
- 888
Hello, I already have a button to attach a renamed Report/.pdf to an email but now I'm needing to attach a second renamed Report/.pdf. How can I do this using the existing code below?
Code:
Dim sExistingReportName As String
Dim sAttachmentName As String
Dim strSViser As String
strSViser = frm.cboSupervisorName.Column(1)
'Input variables
sExistingReportName = "rpt_EmailDailyProduction" 'Name of the Access report Object to send
sAttachmentName = Format(Date, "MM-dd-yyyy") & " " & strSViser & " Superlog" 'Name to be used for the attachment in the e-mail
DoCmd.OpenReport sExistingReportName, acViewPreview, , , acHidden 'Opens report hidden
Reports(sExistingReportName).Caption = sAttachmentName 'by changing the report caption
DoCmd.SendObject acSendReport, sExistingReportName, acFormatPDF, sTOEmailList, , , "Daily Production", stText
DoCmd.Close acReport, sExistingReportName 'Closes the open report