473,412 Members | 3,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

Programatically change printer when a report opens.

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
6 3392
FishVal
2,653 Expert 2GB
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
TAZdba
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
TAZdba
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
2,653 Expert 2GB
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
1,923 Expert 1GB
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
TAZdba
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

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

Similar topics

3
by: gudia | last post by:
I want to Programatically generate Access reports in the pdf format using some tool and then email them to people in the same code. Right now I am trying to do this with pdf995 using VBA (emailing...
4
by: Geir Baardsen | last post by:
Hi! Is there any way to check if printer is active in access 2000? I have a report that is printing (local printer), and before I do anything more in code, I do want to check if printer is...
5
by: Hank | last post by:
My Access 2000 code has been running for several years in our main plant. Now we need to install it, as a stand-along application, at remote sites, some of which are out of state. My problem is...
1
by: Karthic | last post by:
When i right click on the .rpt file in the VS 2003, i see a property printer setting. It says "No printer" on the top and there is option to select printer and paper settings etc.. I want to...
1
by: PCB | last post by:
Hi all! I have a subroutine that prints reports on a specific printer. The code works fine as long as all the printers available to the computer are on the network. However, if the computer also...
7
by: Mark | last post by:
Hi, I am creating application in VB 2005. and when I print report it adds extra 0.45 cm margin on left and top, and the reason for this is physical margins of printer. Is it possible to change...
8
by: Phil Stanton | last post by:
Using Access 2000 (Yes I know there is no Printer specified) and an MDE File (Yes I know I can't open a report in design view). Is there any way using VBA of temporarily changing the report's...
6
by: Ian | last post by:
I am trying to get MS Access 2000 to print names and addresses onto a Dymo 400 label printer, I have set the Access Report to automatically select the correct printer, then select the label size of...
1
by: muddasirmunir | last post by:
i am using vb6 i am facing one problem is datareport that in my computer i had instaled a panasonic printer and the data report show fine but when i take my project to my office computer...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.