Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing default printyer from code

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Is there anyway to allow a user to change their default printer, using VBA? <p>John Vogel<br><a href=mailto:johnvogel@homepage.com>johnvogel@homepage.com</a><br><a href= HomePage</a><br>WebMaster - DataBase Administrator - Programmer<br>
 
No I just set a report to a specific printer like so.<br>
Do you want a report to goto a specific printer?<br>
If so then open the report in design view<br>
Click &quot;File&quot; menu then &quot;Page Setup&quot;<br>
Click &quot;Page&quot; Tab<br>
Click &quot;Use Specific Printer&quot; check box and pick th eprinter <br>
Then Click &quot;File&quot; &quot;Save&quot;<br>
Each time the report is opened it will go to that printer whether by VBA code or manually.<br>
Now if you need to print the same report to 2 different printers at the same time you need 2 reports. both setup as shown above. and 2 lines in VBA.<br>
<br>
heres an example of our reports<br>
-------------------------------------------<br>
ElseIf ORDERType = &quot;R&quot; Then<br>
' RETURNED GOODS EVALUATION<br>
DoCmd.OpenReport &quot;rpt-Returned Goods&quot;, acViewNormal<br>
DoEvents<br>
DoCmd.OpenReport &quot;rpt-RepairEST&quot;, acViewNormal<br>
DoEvents<br>
DoCmd.OpenReport &quot;rpt-Credit Return&quot;, acViewNormal<br>
DoEvents<br>
DoCmd.OpenReport &quot;rpt-Returned Goods-Oki Printer&quot;, acViewNormal<br>
DoEvents<br>
DoCmd.OpenReport &quot;rpt-RepairEST_2&quot;, acViewNormal 'acPreview<br>
DoEvents<br>
<br>
---------------------------------------------------------<br>
so we just go to each printer an grab the reports and it saves tremendous time.<br>
<br>

 
Thank you, will this work, regardless of where the database is opened. This is a multi-user database, ran from various machines, also it is being compiled to an mde file.<br>
<br>
<p>John Vogel<br><a href=mailto:johnvogel@homepage.com>johnvogel@homepage.com</a><br><a href= HomePage</a><br>WebMaster - DataBase Administrator - Programmer<br>
 
It will work if each computer is<br>
1. connected to htat printer<br>
2. the printer name in &quot;settings&quot; &quot;Printers&quot; has to be spelled exactly th esame way.<br>
<br>
Note if you have a mixture of NT workstations and '9x clients that use the report it may NOT work right. for each of them.<br>
<br>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top