I have found a number of threads on this topic, but none of them seem to have been solved or are doing something a little different. I’ll try to keep it simple.
I want to email a report so that each recipient will receive a pdf of only the section of the report that is related to them. I have a table with manager information tblManager. This table has the fields: ID, Team, FirstName, LastName, Phone, Email. I also have a report called rptMonthlyUpdate
My goal is to use vba code to email each manager a filtered report that shows only the information related to their team. Here is the code I attempted. It obviously isn’t working. Any suggestions?
Private Sub btnSendReport_Click()
DoCmd.SendObject acSendReport, "rptMonthlyUpdate", acFormatPDF, DLookup("[Email]", "[tblManager]", "[Team]=" & [Team]), , , "Monthly Report", "Attached is a copy of the monthly report."
End Sub