Setting Report Margins in VBA

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible to set report margins in VBA? The reason why I want to do
this is because the database is on a network drive access by multiple users
that have different margin settings due to different printers being used.

Thanks.
 
If this is Access 2002 or later, you can set the margins of the Printer
object.

The value is in twips, where 1440 twips = 1 inch.
Therefore to set 1/2 inch margins for the report like this:
Dim lngMargin As Long
lngMargin = 720
DoCmd.OpenReport "Report1", acViewPreview
With Reports!Report1.Printer
.TopMargin = lngMargin
.BottomMargin = lngMargin
.LeftMargin = lngMargin
.RightMargin = lngMargin
End With

It is considerably more difficult with older versions, but here's the link
if you need it:
http://msdn.microsoft.com/archive/d...umControllingYourPrinterinMicrosoftAccess.asp
 
Back
Top