View Full Version : Help with script please...


Mark Williams
01-13-2012, 08:50 AM
I have a script that batch prints invoices as selected by a query.

The 'Report.Print' line below works fine and prints an invoice for each matching record in the query.

However, I need to also create a PDF file of each invoice at the same time and the 'Report.SaveAs' line below only creates a PDF file for the first matching record in the query.

What am I missing?


IF prt_type = "Direct to Printer"
Report.Print( "Invoices", query.filter, query.order )

Tom Cone Jr
01-13-2012, 09:59 AM
I think you have to "... SaveAs()..." for each invoice, if you want separate PDF files for each invoice. Each invoice is a separate report, and probably should be saved to disk with a separate name. You'll need to use a looping structure in your code to do them one at a time, changing the PDF name on each trip through the loop.