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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code on PrintReport_Click to specifiy page setup 1

Status
Not open for further replies.

MaddiMond

Technical User
Mar 28, 2005
76
0
0
US
I wonder if I can put a codeline into the regular printreport code that specifies that the report has to be previewed and printed always in layout page setup. I have to keep changing the page setup of the report manually through the file menu and it has become a big hassle. Somehow the format always changes in my database, although it should be stored according to microsoft online. I tried to find help in the VB library, but unsuccessful so far..

Private Sub PrintReport_Click()
On Error GoTo Err_PrintReport_Click

Dim stDocName As String

stDocName = "rpt"
DoCmd.OpenReport stDocName, acNormal

Exit_PrintReport_Click:
Exit Sub

Err_PrintReport_Click:
MsgBox Err.Description
Resume Exit_PrintReport_Click

End Sub

Thanks for your help.

Maddi
 
I'm not sure what you mean "layout page setup"! Are you saying that you want the page setup dialog to appear every time you run the report or something else?

Can you describe any more what it is you want.

Ben

----------------------------------------------
Ben O'Hara
David W. Fenton said:
We could be confused in exactly the same way, but confusion might be like Nulls, and not comparable.
 
No. Oftentimes when a user hits print preview, the report opens in Portrait and half the numbers are invisible. So the problem is that he always has to go to File--> PageSetup and change the orientation manually. I have been told this is a drag. Furthermore, in the Access manual it says that if you save page setup for a report or form once, the same orientation is saved for the next time, but this does not happen in my database.

Sometimes the report opens in landscape, sometimes in portrait.

Maddi
 
I too have the same issue however mine also includes page size legal or letter. I would be interested in a potential solution.

Thanks
Eileen
 
I've sometimes had this problem. IIRC you have to build your report, change the page settings in design mode, then save the report. That usually fixes it.

If you want to change paper size, layout, etc at runtime, then the technique is detailed at
Let me know if you need more help.

Ben

----------------------------------------------
Ben O'Hara
David W. Fenton said:
We could be confused in exactly the same way, but confusion might be like Nulls, and not comparable.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top