Setting Paper Size and Printer Using Code

gjgerson

New member
Local time
Today, 07:48
Joined
Mar 5, 2006
Messages
8
I have been beating my head against the wall for some time now trying to figure out how to control the page setup settings in a couple of Access reports. All I really need to do is make sure the report prints to the default printer and that it uses a custom papersize I created on the print server called AirTranXP. I only have 4 reports in which I need to do this, but I have other reports that are formatted for a different type of printer using different settings. So any code I add needs to only affect the 4 reports.

I found some code, but I don't understand how to make it work. I am not sure where to put it or how to use it properly. Can anyone help me? Please!


Sub SetPrinter(strFormname As String)

DoCmd.OpenForm FormName:=strFormname, view:=acDesign, _
datamode:=acFormEdit, windowmode:=acHidden

With Forms(form1).Printer

.TopMargin = 1440
.BottomMargin = 1440
.LeftMargin = 1440
.RightMargin = 1440

.ColumnSpacing = 360
.RowSpacing = 360

.ColorMode = acPRCMColor
.DataOnly = False
.DefaultSize = False
.ItemSizeHeight = 2880
.ItemSizeWidth = 2880
.ItemLayout = acPRVerticalColumnLayout
.ItemsAcross = 6

.Copies = 1
.Orientation = acPRORLandscape
.Duplex = acPRDPVertical
.PaperBin = acPRBNAuto
.PaperSize = acPRPSLetter
.PrintQuality = acPRPQMedium

End With

DoCmd.Close objecttype:=acForm, objectname:=strFormname, _
Save:=acSaveYes


End Sub
 
I’m in the same boat lol. Since my new database is multi-user I have no way of controlling the paper size. I need a specific report to always use 8 ½ by 14 paper.

Anyone find a solution to this problem?

Yea, I know this is an old thread. I'll continue to look and if I find something I'll post it for others who may have the same question some day.
 

Users who are viewing this thread

Back
Top Bottom