Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hard Code Printer

Status
Not open for further replies.

redbird59

Programmer
Jan 7, 2003
6
CA
I need to hard code the destination printer for a report from an Access 97 application. Does anyone know the vba code for doing this?
 
You don't need VBA code.

Under the file menu, click "Page Setup".

Click the "Page" tab. Check the box by "Use Specific Printer", then select the printer.

Save the report, and it will default to printing on the printer you selected.
 
I found an interesting article on the Microsoft site.
I'm trying to set a specific printer as you've requested, but haven't managed it yet. If anyone else manages to get it working, please post code. I will if I succeed.

There are drawbacks though, if you do get it working.

1. Won't work in MDE

2. Won't work in Runtime enviroment.

3. In a secure app, will have to allow user design view rights.
 
If you set it up as I described above, in Page Setup, you don't need code.

It does work in a runtime environment. If the specified printer isn't available on that system, it will print to the default printer.

 
Thanks GDGarth. The problem I am trying to avoid is the app printing to any other printer, including the default printer. It MUST print only to the specific printer and when we set these values through page setup it allows the app to print to a default. This then redefines the default printer for the app. What I need to do is define the printer specifically do that it will print only to that printer and generate an error message if that printer is not available.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top