Access reports printing to wrong printer

This is a problem i just cant figure out.

When i develop an access report i always set the printer to default printer in the page setup.

But when user prints a report it comes out my printer.

It seems that when i make an mde file, Access compiles my printer information into the mde.

Does anyone know of this problem and perhaps a solution?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

A solution I'd suggest is to actually set the printer programatically for each report the user runs and is something I typically do for all programs we write. In fact we often save the last printer used by a user per report so that reports needing to go to different print locations i.e. sometimes certain reports go to colour printer and others to black lasers then they always default to the last location.

Not sure though if you've coded your own switchboard and menu system which would allow for that.
NorushAuthor Commented:
But is this a problem a knows 'bug' ?

I mean if you set the pagesetup to default printer the workaround shouldnt be neccesary at al.
I know that very often diff versions of Access give problems with the printer e.g. you set a specfic printer on the report and defaults back to default printer or vice versa. The initial default printer that Access uses is the one that is set on your system when Access is launched. So check on those PCs where it is deployed what the default printer is after launching you app and then trying changing it.

If you go the code route you'd give the user a drop down listing printers on the system and you can try use this code snippet I've seen before by Steve Arbaugh:
Private Sub SetAppPrinter(strPrinterName As String)
'StrPrinterName is the name of the target printer of
'choice to set as the application's "default" printer.
On Error Resume Next
Dim objPrinter As Object
Dim App As Object
Dim strPrinter As String
Set App = Application
  If Val(SysCmd(acSysCmdAccessVer)) >= 10 Then
    For Each objPrinter In App.Printers
      strPrinter = objPrinter.DeviceName
      If strPrinter = strPrinterName Then
        Set App.Printer = objPrinter
        'Optionally Break Here
        'Exit for
      End If
  End If
End Sub

Also check if any service packs are available perhaps if you don't want to go the code route.
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
"I mean if you set the pagesetup to default printer the workaround shouldnt be neccesary at al."

Agreed.  Something very ODD is going on ... not sure I heard of this issue before.

Try quickly uninstalling then reinstalling the Default printer.  Also, I assume other app *can* print to THAT printer ?

Jeffrey CoachmanMIS LiasonCommented:


And I am curious as to what would happen if you had *NO* printers installed on your machine, then created the MDE.
What would happen then?

NorushAuthor Commented:
I will try out your advices this monday and let you know if it works.

Have a good weekend.

Cheers, Norush
NorushAuthor Commented:
I took the code-route putting the code z3r3 supplied in the onload event of each report.

I also found a function that finds the default windows-printer and used that to call z3r3's function.

But no effect.

The code runs fine at the users computers.

But Set App.Printer = objPrinter just doesnt do the trick.

When the user hoovers over the print button is says: "No printer"
NorushAuthor Commented:
Extra comment: Users can print fine from applications like excel, word etc...
Hmm, I'll do a small test app from scratch and see if I get the same issue.
I've attached a test one that works fine for me. You may want o do things differently but this shows it working nicely.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jeffrey CoachmanMIS LiasonCommented:

Embed the zip file in a Word Doc!

nice workaround!
NorushAuthor Commented:
So i have the users a choice of printers and used your code and it works now.

The real solution to this problem is to open access.  The goto  FILE   PAGE SETUP   PAGE  and tell access to print to the users Default printer instead of your specific one.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.