specified criteria with outputto?

S

SF

Hi,


If I want to print a report by specifying criterion I used
DoCmd.OpenReport "rptMOFReceiveForm", acViewPreview, , "[Ref ID]=" &
Me.Me_MOFRef_ID

How can I specified criteria with the OutputTo
DoCmd.OutputTo acOutputReport, "rptMOFReceiveForm", acFormatPDF,
"C:\Myreport.pdf" , 1

Regards
 
5

::{59031A47-3F72-44A7-89C5-5595FE6B30EE} \(file://

::{59031A47-3F72-44A7-89C5-5595FE6B30EE} (file://ADM-PC/Users/pierreyb)
 
A

Allen Browne

As you found, there's no WhereCondition for OutputTo.

Your choices are therefore to either:
a) put the criteria into the query that feeds the report, or
b) apply a filter in the report's Open event.

For (a), in the Criteria row of the report's source query under the [Ref ID]
field, enter something like this:
[Forms]![Form1]![Me MOFRef ID]

For (b), write code that creates the filter string and assigns it to the
report's Filter property, remembers to set FilterOn to true as well.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top