MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.
Public Sub SetMarginsToDefault() 'Uses a global string "strOpenreport" set to the name of the currently open report 'Allows use of this sub from any open report 'Set margin defaults for Letter or A4 size paper depending on region ' First, determine what size is the regional default ' looks up and assigns regional default based on user's looked up region, allows for additional defualt types Dim setRegionalMargin 'setRegionalMargin = "letter" 'comment in/out for testing 'setRegionalMargin = "A4" 'comment in/out for testing setRegionalMargin = DLookup("PaperSize", "tblRegion", "Region = " & "'" & varRegion & "'") 'specifies the regional paper size and margin format in twips Select Case setRegionalMargin Case "A4" With Reports(strOpenreport).Printer .PaperSize = acPRPSA4 .LeftMargin = 0.65 * 1440 .TopMargin = 0.5 * 1440 .RightMargin = 0.25 * 1440 .BottomMargin = 0.125 * 1440 End With Case "Letter" With Reports(strOpenreport).Printer .PaperSize = acPRPSLetter .LeftMargin = 0.3 * 1440 .TopMargin = 0.625 * 1440 .RightMargin = 0.25 * 1440 .BottomMargin = 0.25 * 1440 End With End Select End Sub
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
15 Experts available now in Live!