473,385 Members | 1,838 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,385 software developers and data experts.

Access 2007 Sending Prints to Wrong Printer

OK, is Access 2007 driving anyone else nuts? I've got three lines of VBA code that sends a report to the printer:

Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenReport RPT_NAME, acViewPreview, , , , ARGS
  2. DoCmd.RunCommand acCmdQuickPrint
  3. DoCmd.Close acReport, RPT_NAME, acSaveNo
These lines worked perfectly in Access 2003. Now with 2007, the report is being sent to the wrong printer. I don't understand why Access 2007 has choosen the particular printer it's sending the reports to. The printer the reports are going to is not the current printer in Access, nor is it the default printer for the computer.

I tried inserting the following line at the beginning to force the report to go to the default printer, but this has had no effect. The reports are still going to the same wrong printer.

Expand|Select|Wrap|Line Numbers
  1. Set Application.Printer = Application.Printers(0)
Does anyone understand what Access is doing? Am I missing something?

Thanks for the help.
sphinney
Jun 3 '08 #1
2 7034
mshmyob
904 Expert 512MB
try setting your default printer like so and let me know if it helps.

Expand|Select|Wrap|Line Numbers
  1. Dim strDefaultPrinter  As String
  2. ' get current default printer.
  3. strDefaultPrinter = Application.Printer.DeviceName
  4. ' set to the printer
  5. Set Application.Printer = Application.Printers(strDefaultPrinter)
  6.  
cheers,

OK, is Access 2007 driving anyone else nuts? I've got three lines of VBA code that sends a report to the printer:

Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenReport RPT_NAME, acViewPreview, , , , ARGS
  2. DoCmd.RunCommand acCmdQuickPrint
  3. DoCmd.Close acReport, RPT_NAME, acSaveNo
These lines worked perfectly in Access 2003. Now with 2007, the report is being sent to the wrong printer. I don't understand why Access 2007 has choosen the particular printer it's sending the reports to. The printer the reports are going to is not the current printer in Access, nor is it the default printer for the computer.

I tried inserting the following line at the beginning to force the report to go to the default printer, but this has had no effect. The reports are still going to the same wrong printer.

Expand|Select|Wrap|Line Numbers
  1. Set Application.Printer = Application.Printers(0)
Does anyone understand what Access is doing? Am I missing something?

Thanks for the help.
sphinney
Jun 3 '08 #2
missinglinq
3,532 Expert 2GB
There is a bug in 2007 that prevents the assigning of a specific printer that Microsoft has issued a hotfix for:

http://support.microsoft.com/kb/950488

Linq ;0)>
Jun 3 '08 #3

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

Similar topics

0
by: Esmee | last post by:
Hi there, I have created an Access 2002 db which contains several reports. Some reports need to be printed on a Laserjet and others on a Labelprinter. One of my clients wants to be able to print...
0
by: Art Chadbourne | last post by:
I have an Access 2000 Application with about 300 reports It runs on win 98, win 2000 and XP. The problem I am having is that my users can have any printer there are over 5000 of them. In Access 97...
7
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I...
11
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
16
by: cyranoVR | last post by:
This is the approach I used to automate printing of Microsoft Access reports to PDF format i.e. unattended and without annoying "Save As..." dialogs, and - more importantly - without having to use...
13
by: salad | last post by:
Hi Guys: I was stuck. I needed to send a report to a file. My beautiful report(s) in Access were going to require loss of formatting with RTFs, a PITA in WordMailMerge, sending it as a text...
1
by: Paul Aspinall | last post by:
Hi I'm writing a web based system, which needs to direct prints to a Zebra barcode printer. I plan to use the ZPL (Zebra's own) programming language for sending Raw ASCII to the printer, and...
0
by: Charles Crawford | last post by:
Hi, This apparently is a common problem and I've yet to read a solution that actually works for my specific situation. I have a Zebra RW220 printer that I connect to via Bluetooth connection...
0
by: =?Utf-8?B?Q2hhcmxpZQ==?= | last post by:
Hi, This apparently is a common problem and I've yet to read a solution that actually works for my specific situation. I have a Zebra RW220 printer that I connect to via Bluetooth connection...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...

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.