Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

VBA to send two reports as PDF as two attachments in one emaiil

$
0
0
I am trying to get two reports attached to a single email as attachments. Right now I have the two reports getting attached into two separate emails.

Quote:

Private Sub cmdEmail_Click()
On Error GoTo Err_cmdEmail_Click

If MsgBox("Are you ready to Email the Night Warehouse Operations Summary?", VbMsgBoxStyle.vbYesNo Or VbMsgBoxStyle.vbExclamation, "Email Report") = vbYes Then

DoCmd.SendObject acReport, "rptNight_Summary_Report", "PDFFormat(*.pdf)", "emailaddress", "", "", "Night Warehouse Operations Summary", "Please see attached Night Warehouse Operations Summary", False, ""
DoCmd.SendObject acReport, "rptAttendance", "PDFFormat(*.pdf)", "emailaddress", "", "", "Night Warehouse Operations Summary", "Please see attached Night Warehouse Attendance Summary", False, ""
Exit Sub
Else
End If
Exit_cmdEmail_Click:
Exit Sub
Err_cmdEmail_Click:
MsgBox Err.Description
Resume Exit_cmdEmail_Click
End Sub
how do i combine the two docmd.sendobject's to make one? Haven't had much luck trying.

Viewing all articles
Browse latest Browse all 13329

Trending Articles