Printing a report to a specific printer name by using code rather that report setting

M

markshowell

Can you using code print a report to a named specific printer?

I know that you can set a report to print to either the default printe
or a specific printer in the Page Setup setting for the report bu
ideally I would like specify the printer name by code
 
S

SA

Mark:

The answer to this varies by version of Access you are using. If you are
using anything less than Access 2002 (Xp), then the normal method is to set
your report to use the default printer and then set the Windows default
prior to outputting your report. There's lots of places to fine code to do
just that including in the MS Knowledgebase, MSDN etc.

If you are using Access 2002 or greater, then still set your report to use
the default printer and before output, set the Access Application object's
..Printer property to the target printer you want to use. Setting the
Windows default printer alone in Access 2002 and above will not do the
trick. If you do a google search on Application.Printer you should find
ample samples (including one I posted about a month and a half ago) on
exactly the code to do just that.

If you don't want to take the time to do all the searching and want have
even more functionality than just setting the default, then you might want
to look at our "On the Fly Printing" classes for Access. They provide a
simple class call the printers class that you can drop into your app and
with one method call accomplish setting your target printer. But of course
there's a lot more functionality than that included. Could save you some
time. You'll find it on our web.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top