Prev: Chart Question
Next: a
From: SF on
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


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


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

From: Allen Browne on
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.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"SF" <samnangs(a)pactcambodia.org> wrote in message
news:Or30uS51KHA.2156(a)TK2MSFTNGP02.phx.gbl...
> 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
>
From: David Jennings on
REMOVE NOW!!!!!!!!!!!!!!!!!!!!!!!!!
"SF" <samnangs(a)pactcambodia.org> wrote in message
news:Or30uS51KHA.2156(a)TK2MSFTNGP02.phx.gbl...
> 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
>

 | 
Pages: 1
Prev: Chart Question
Next: a