Printer used with docmd.printout

wouterdn

New member
Local time
Today, 19:40
Joined
Oct 30, 2013
Messages
3
Hello,

I've come accross the following issue when using the docmd.printout command in vba.

I have a listbox in a form which can contain a variable amount of reports.
I've created a button to print all these reports to the standard printer.
Due to vba-code that runs when I open a single report, I have to open each report separately.
Also due to this vba-code, I can not open the report in acViewNormal.

I've now created a loop that always opens the report in acViewPreview and then I run the docmd.printout command.
The first report is printed correctly to the standard printer and then closed.
The next report is opened and printed, but instead of the standard printer, it uses my pdf-printer.
Does anyone have an idea why this is the case?

I tried setting the printer to the standard printer in the loop before the report opens, but still the same.

With kind regards,
 
Can you post your code?

Are there any saved property settings differences between the one reprot that prints properly and the ones that do not?

If you open the report(s) in PrintView and select "Page Setup" and select the "Page" tab, is the report set to "Default Printer" or "Specific Printer"?
 
I can't say why you have troubles.
But I can ask why use the PrintOut command and not, simply

DoCmd.OpenReport ("ReportName")

For me is good enough and always the default printer is used.
 
I can't say why you have troubles.
But I can ask why use the PrintOut command and not, simply

DoCmd.OpenReport ("ReportName")

For me is good enough and always the default printer is used.

I would prefer that as well.
But when I open my report, there is some vba-code running (e.g.: a prefix in front of the number, one of the two subreports is hidden depending on whether it contains any data or not, ...)
Problem is that apparentely, that code is not running when you open the report in acViewNormal (=DoCmd.OpenReport ("ReportName"))

So therefore I open the report in preview and use the printout command.

I'll post my code when I'm back at the office.

With kind regards
 
Can you post your code?

Are there any saved property settings differences between the one reprot that prints properly and the ones that do not?

If you open the report(s) in PrintView and select "Page Setup" and select the "Page" tab, is the report set to "Default Printer" or "Specific Printer"?

You were right.
I should always check the basic settings first. :o
Thank you very much!

Kind regards
 

Users who are viewing this thread

Back
Top Bottom