DoCmd.OutputTo acOutputReport

Magster

Registered User.
Local time
Today, 15:33
Joined
Jul 30, 2008
Messages
115
Hi all,

How can I change the RecordSource of a report being called in VBA using the doCmd.OutputTo creating a pdf file?

As others have mentioned, there isn't a way to create a where clause or filter on the following:
DoCmd.OutputTo acOutputReport, "ProjectSheet-Delay", acFormatPDF, strFileNameAndPath


I tried to trap the report load and open events where I know I can change the recordsource because the report is open - but the doCmd.OutputTo doesn't appear to actually open or load the report? Do I have to actually open the report and filter it?

Thanks for reading...
 
I will assume that you are using Access 2007. Is that correct?

You may need to edit the QueryDef before the DoCmd.OutputTo. That is how I normally would handle this.
 
Yes, I'm using 2007 - I'll check into the help documentation for the QueryDef - never thought of that... thanks
 
Last edited:

Users who are viewing this thread

Back
Top Bottom