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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Default printer help 1

Status
Not open for further replies.

xezekielx

IS-IT--Management
Jun 30, 2005
93
CA
Hi! I have a small (I hope!) problem. I change the default printer (using the registry keys) to the virtual PDF printer. This works. I can also change it back to whatever the old printer was without any problem. The problem is that when I open the report with the acViewNormal parameter after changing the default printer, the report is sent to the previous default printer, not the PDF one... What am I doing wrong?

N.B. I used the code in the FAQs (which can be found here change the default printer with the registry keys
 
Hi xEzekielx

If the report in question is always printed to the same printer, you can specify this in the report's page setup.

Open the report in design view, then File > Page Setup > Page and check the Use Specific Printer option. Then you can select from the printer list.

Hope this helps

Mac
 
Well the thing is I want to change printers on the fly, without having to go in the page setup. In Access XP I could have used the printers collection but it's non-existant in Access 2000...
 
Can't anyone help me out? Is it really THAT hard to do? Is the code in the faqs supposed to work or not? And if it works, why doesn't it work with other printers as well?
 
Thanks MacCaillean but I have already tried what was on that page without any success... well.. changing the PrtDevNames and PrtDevModes properties work but have caused bugs more than once. I also don't want to use the Page setup like I've already said in a previous post. On the Microsoft page you linked me to, it says that the report will print to the Windows default printer but it doesn't seem to work. I'm able to change the default printer through code but when I send a report to print, it is sent to the old default printer instead of the new one.
 
Hi xEzekielx

Okay - just to clarify - a single report needs copies to be printed to different printers, and you want to change the settings on the fly.

The code you run just now appears to successfully change the default printer, but the report still prints to the old one.

Things to consider

[ul]
[li]Are you changing the default printer at the right time?[/li]
[li]Does your report already have 'Use Specific Printer' set to the wrong printer?[/li]
[li]If you open and print a second report, does it go to the old or to the new default printer?[/li]
[/ul]

If none of these questions help you, and you cannot use the Microsoft-endorsed method, then we need one of the real clever Tek-Tipsters to come to the rescue!

Regards

Mac
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top