473,398 Members | 2,212 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,398 software developers and data experts.

Call printer by name via code

I have multiple reports that use a "specific printer" because the
default printer is tied up doing other chores.
This is a machine shop environment using Dells' running Win2000 and
XP with Access2003 loaded.
The specific printer is a serial 24 pin dot matrix printer designed to
produce wax stencils.
Some of the PC have Com1 open others have Com2 open and others are
using both Com Ports. I will have to purchase Serial to USB adapters
to get the later PC's to accept the printers.
The problem:
I don't want to have 3 or more versions of the program running to
accommodate all the different flavors of printer configuration.

Is there a way to call up the printer, by name, in code, at run time,
so it won't matter what port the printer is using?

Thanks, Rick

Nov 13 '05 #1
3 3327
First of all, if you intend to reach any specific printer on your network,
then you don't need to fuss with com ports, etc., just install as many
different printers as you need for each workstation. If you intend to have
a dedicated dot matrix for each workstation, then yes, you do.

Secondly, when in report design, go to "File -Page Setup"; there is a dialog
to set the default printer or any of the specific printers that a
workstation has been configured for. You should't have to do anything else.
Users can also always use the Windows Print dialog (Ctrl-P) to change any
printer spec.
-Ed

"2D Rick" <rb*******@compuserve.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
I have multiple reports that use a "specific printer" because the
default printer is tied up doing other chores.
This is a machine shop environment using Dells' running Win2000 and
XP with Access2003 loaded.
The specific printer is a serial 24 pin dot matrix printer designed to
produce wax stencils.
Some of the PC have Com1 open others have Com2 open and others are
using both Com Ports. I will have to purchase Serial to USB adapters
to get the later PC's to accept the printers.
The problem:
I don't want to have 3 or more versions of the program running to
accommodate all the different flavors of printer configuration.

Is there a way to call up the printer, by name, in code, at run time,
so it won't matter what port the printer is using?

Thanks, Rick

Nov 13 '05 #2
Thanks for your reply Ed.
If you intend to have

a dedicated dot matrix for each workstation, then yes, you do.<

Printers will be local and have a dedicated task.
They will connect via Com1, Com2, or USB depending on which port is
available.
All Printers will be assigned the same name "Epson LQ-1170 ESC/P 2"
which was assigned when using "adding printer" wizard.

Each time I load the MDB on a PC I have to open each report and reset
it to the specific printer/port. If I can change the default printer to
"Epson LQ-1170 ESC/P 2" and print then set default back, I won't have
to go into report setup.
Even better, Can I just send the report to the printer named "Epson
LQ-1170 ESC/P 2" without messing with the default printer.

Any suggestions, Rick

Nov 13 '05 #3
Yes, the best approach (and one that you hint at) is to NOT set a specific
printer for a report.
(This is way to hard to manage, and just changing a printer means you have
to change your reports!!).

So, leave all reports to the default printer.

You can then make some config table, or whatever, and SET THE printer in
code.

Here is how:

In access 2002 and later, there is a built in printer object, and it lets
you switch the printer with ease.

You can use:

Set Application.Printer = Application.Printers("HP LaserJet Series II")

So, to save/switch, you can use:

dim strDefaultPrinter as string

' get current default printer.
strDefaultPrinter = Application.Printer.DeviceName

' switch to printer of your choice:

Set Application.Printer = Application.Printers("HP LaserJet Series II")

do whatever.

Swtich back.

Set Application.Printer = Application.Printers(strDefaultPrinter)
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com
http://www.members.shaw.ca/AlbertKallal
Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Pablo | last post by:
Friends, how can i get the name of the default printer??. I'm working with winforms. VB,C#, nevermind. Thanks a lot Pablo
6
by: Stephan Perschke | last post by:
Hi, I try to change some printer settings using the win32 api OpenPrinter, GetPrinter and SetPrinter. I copied most of the code from this or related newsgroups. However, OpenPrinter, GetPrinter...
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...
6
by: Ioannis Demetriades | last post by:
Hi, I need to change the printer's font to "control" -a printer font, and then send a sequence of characters to the printer. My problem is that I cannot change the printer's font. Can this be...
0
by: Dawn | last post by:
My application is coded to create a report using Excel and I would like to send it directly to a pre-determined network printer. (My intention is to pass the printer name in a variable.) However,...
6
by: notregister | last post by:
hi, i have been trying to send a printer-ready data to an unknown printer to print. the reason why the printer is unknown is that i do no wish installed any printer driver. so at the end my...
2
by: TARUN | last post by:
Hello all, Please help and suggest the code to get the printer status over the network. for Example, i have an string "\\\\os1\\PtName" where os1 is the system name and PtName is the printer...
4
ADezii
by: ADezii | last post by:
Recently, there seems to be several questions specifically related to Printers and changing Printing characteristics for Forms and Reports. For this reason alone, I decided to dedicate this week's...
10
by: bhughes2187 | last post by:
Hey all, The access app I am creating, pulls a .dbf file into a table in access. The name of the printer to be printed to is contained in that file/table. How would I cycle through the list of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.