By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,327 Members | 1,806 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,327 IT Pros & Developers. It's quick & easy.

Programatically change printer when a report opens.

P: 5
Hi All,
I have an Access97 frontend on a SQL Server 2005 back end database. Reading your forums, I discovered how to generate a dropdown list of available printers. I can also store the user's choice from the listbox in a front-end table. Now I need to know: Do you have any code that I can use to assign the printer to the report in the on_open event of the report? FYI, I'm trying to allow workstation users to define 2 default printers, 1 for sheet reports and another for labels. Any help would be much appreciated.
Aug 6 '07 #1
Share this Question
Share on Google+
6 Replies


FishVal
Expert 2.5K+
P: 2,653
Hi All,
I have an Access97 frontend on a SQL Server 2005 back end database. Reading your forums, I discovered how to generate a dropdown list of available printers. I can also store the user's choice from the listbox in a front-end table. Now I need to know: Do you have any code that I can use to assign the printer to the report in the on_open event of the report? FYI, I'm trying to allow workstation users to define 2 default printers, 1 for sheet reports and another for labels. Any help would be much appreciated.
Hi.

See "ActivePrinter property" topic in Access help.
Aug 6 '07 #2

P: 5
Hi.

See "ActivePrinter property" topic in Access help.
I couldn't find any "ActivePrinter" in Access97 help or in the VBA object browser. Where should I look next?
Aug 6 '07 #3

P: 5
I need to select a printer in a list box, and then print reports to that printer until the selection is changed. Any ideas? Please?
Aug 10 '07 #4

FishVal
Expert 2.5K+
P: 2,653
I need to select a printer in a list box, and then print reports to that printer until the selection is changed. Any ideas? Please?
Sorry, I've never dealt with A97. I will ask the community to help you.
Aug 10 '07 #5

puppydogbuddy
Expert 100+
P: 1,923
Sorry, I've never dealt with A97. I will ask the community to help you.
See this tip from www.aadconsulting.com

Tip and Code Sample: Switching Printers from within your MS Access Application

Fellow Access develepor, Mark Plumpton, of customdata.co.nz, has kindly provided sample code for easily switching printers on the fly while printing Access reports, with code as simple as this...

SaveDefaultPrinter
DefaultPrinter = "HP Laserjet (A3)"
DoCmd.OpenReport "rptTest", acViewNormal
RestoreDefaultPrinter

Download these demo Access97/2000 databases, which include a class module that performs the function of listing and switching default printers.
http://www.aadconsulting.com/printers.zip
The code is also an excellent example of how you can use classes in your MS Access applications.
Aug 10 '07 #6

P: 5
See this tip from www.aadconsulting.com

Tip and Code Sample: Switching Printers from within your MS Access Application

Fellow Access develepor, Mark Plumpton, of customdata.co.nz, has kindly provided sample code for easily switching printers on the fly while printing Access reports, with code as simple as this...

SaveDefaultPrinter
DefaultPrinter = "HP Laserjet (A3)"
DoCmd.OpenReport "rptTest", acViewNormal
RestoreDefaultPrinter

Download these demo Access97/2000 databases, which include a class module that performs the function of listing and switching default printers.
http://www.aadconsulting.com/printers.zip
The code is also an excellent example of how you can use classes in your MS Access applications.
Hi and thanks PuppyDogBuddy,
I haven't tried it yet, but this looks like exactly the kind of information that I was looking for. Thanks again.
Aug 14 '07 #7

Post your reply

Sign in to post your reply or Sign up for a free account.