VBA to print to specific printer with print button

5 pts.
Tags:
Code
Microsoft Access
Microsoft Access 2007
VBA
In Access 2007 how do I use VBA code in my print button to print to a "specific printer" for my report.

Answer Wiki

Thanks. We'll let you know when a new response is added.

If it is not necessary to do it in VBA code, you can go to the page setup on the report and set specfic printer there and it will save with the report.

If you need to do it in VBA, you will need to open the report in preview mode. Then the following command may work; but I haven’t tried it. (Note: Reports(0) is the current report that is being previewed)

reports(0).Printer.devicename = “My Printer”

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • SbElectric
    Good information - I was not aware of this option. Just tried & it works fine. One can always learn good tips from this type of forum.
    2,540 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following