Question : MS Access: E-mailing a Parameter Query-Based Report

I am attempting to, from an Access button's onClickEvent, e-mail a report as an attachment to a recipient (of the user's choosing...the recipients won't be automated)...that is, I would like to have the onClick event simply open the default mail client, and create a blank message with a given report as the attachment...

Now, here's the monkey wrench:  The report in question is based on a parameter query.  The query pulls a values from a drop-down list value on the form, passes it into the query, and then the report is run from that query.  

I have the syntax to e-mail a non-parameter-query-based report (A) from access, and the syntax to open the parmeter-based query report (B):

A:  DoCmd.SendObject acSendReport, "TestRpt", acFormatRTF
B:  DoCmd.OpenReport "qry_PayorRpt_Month", acViewPreview, , "Month = '" & Forms!frm_rpts!cmb_Month & "'"

My question is, how do I combine both methods (DoCmd.SendObject and DoCmd.OpenReport), such that I can pass the parameters into the query, run the query, obtain the report, and then e-mail THAT report as an attachment??

Answer : MS Access: E-mailing a Parameter Query-Based Report

If your report is based on the parameter query then there is no need to run the query separately.
You just send the report.
Random Solutions  
 
programming4us programming4us