Microsoft Access printer orientation problem

I have an application that prints several different types of reports in Microsoft Access
I am attempting to send the mailing label report to the costar label printer and set the orientation to landscape
I am using the following code:

Dim strDefaultPrinter As String
              strDefaultPrinter = Application.Printer.DeviceName
              Set Application.Printer = Application.Printers("Costar printer")
              Application.Printer.Orientation = acPRORLandscape

It sends the report to the printer, but ignores the orientation.  Please help...


Who is Participating?
Jose ParrotGraphics ExpertCommented:
I'm quite confuse. Seems as a report sent to the costar label printer.

Anyway, I didn't noticed in the code if the printer object was created before invoke the printer.
Something like:

' Variable for the printer object.
Dim prt As Printer

Also, the code reffers to the costar printer as the default printer, but the default could be another one, for instance the one that you use to print full page reports.

So, probably the code is working properly for the default printer, not for the costar.


power1007Author Commented:
Yes, I had already instansiated the printer.  The simple solution was to change the properties on the page setup of the report and specify a printer there.  Thanks for the help.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.