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 "works":<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>
<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 "works":<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>