Printing part of a report to a PDF with ApplyFilter and a loop (1 Viewer)

NebraskaUser

Registered User.
Local time
Today, 11:55
Joined
Aug 17, 2018
Messages
12
Merry Christmas Everyone - Can anyone give me insight as to how to write a filter of a query or report to a PDF and then send that PDF as an attachment to an email? I also want a cover letter to go to the email recipient. Nothing I've tried has worked. I have a button that executes the following code:

Private Sub MailContributionReports_Click()
DoCmd.RunMacro ("EmailRept")
End Sub

My EmailRept macro does an OpenQuery, SelectObject, ApplyFilter and EMailDatabaseObject. I get the email with the PDF attachment, but the PDF attachment has the data for every envelope ID instead of just the one envelope ID I specified in the ApplyFilter. The ApplyFilter's Where Condition is coded -
="[RSC_Env_ID] = '1'".

any help is greatly appreciated.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 02:55
Joined
May 7, 2009
Messages
19,169
you can create another query that has Filter By Form, and use this in your macro.
 

Users who are viewing this thread

Top Bottom