specified criteria with outputto?

  • Thread starter Thread starter SF
  • Start date Start date
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
 
::{59031A47-3F72-44A7-89C5-5595FE6B30EE} (file://ADM-PC/Users/pierreyb)
 
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.
 
Back
Top