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 How The Printer Prints

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Okay, here is what I am doing. I have an autogenerated report, which can be accessed via a button. When the button is clicked, it opens the report, and a report menu, which gives the user the option to eithor print the report, save it to a file, or email it. <br>
<br>
Here is where I am having problems. I use the code DoCmd.OpenReport stDocName, acViewNormal to print the report. The report is printed fine, except that I need for it to print out landscape style on legal paper.<br>
<br>
I know I can easily do this by using the following code, but I would prefer to do this completely transparently.<br>
<br>
Here is what I have found that &quot;works&quot;:<br>
<br>
Dim rpt As Report<br>
Dim stDocName As String<br>
For Each rpt In Reports<br>
stDocName = rpt.Name<br>
Next rpt<br>
DoCmd.SelectObject acReport, stDocName<br>
DoCmd.RunCommand acCmdPageSetup<br>
DoCmd.OpenReport stDocName, acViewNormal<br>
<br>
All this basically does is finds the report's name, then selects it, runs the Page setup dialogue, then prints the report. <br>
<br>
THanks in advance for any assistance.<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>
 
Well this is a age old question. in this forum that I have answered a half dozen times.<br>
See in Access you can save a specific printer and its definitions (i.e. Landscape) in the report.<br>
So when it is oipeneed it will do the same thing everytime.<br>
<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 the printer<br>
then click Properties on the Printer selection box and click the Landscape button <br>
After your done with all of your printer settings<br>
Then Click &quot;File&quot; &quot;Save&quot; to save the report.<br>
<br>
Each time the report is opened it will go to that printer whether by VBA code or manually.<br>
So when you call the report just use<br>
DoCmd.OpenReport &quot;rpt-Returned Goods&quot;, acViewNormal<br>
and it will print out in landscape.<br>
<br>
<br>

 
Thank you. I tried this earlier, and it didn't keep the setting (Clicked on landscape and Legal), I did not click on the user specific printer box. Does this require that everyone uses the same printer, however? <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>
 
Yes if several people are printing the same report from different machines.<br>
then they all have to have the same Operating system and their Printer name in &quot;Start&quot; &quot;settings&quot; &quot;printers&quot; must be spelled exactly the same. <p> DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br>
 
Is there another way of doing it then? There may be several differant departments accessing this program, and each would have a unique printer, as well as there being several printers in each department. <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>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top