[AccessD] How do you use VBA to adjust Report Print Margins

Edward S Zuris edzedz at comcast.net
Wed Apr 16 17:12:02 CDT 2008


 I now have Microsoft Access printing on preprinted
 forms/sheets by using twips to place textbox's on
 the report.

 However, I am having trouble finding object or VBA
 code that adjusts Access's Report Page Setup for
 setting the report printing margins.

 It would be helpful to have the following code adjust
 the just this report's print margins.

 Any ideas ?

 Thanks.

 = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

    sData = ""
    sData = "=" & Chr$(34) & Trim$([rsData]![zData] & " ") & Chr$(34)

    sReportName = ""
    sReportName = zzReport.Name

    Set RptCtrl = CreateReportControl(zzReport.Name, acTextBox, acDetail, ,
sData)

    dsTop = CDbl([rsData]![LineY])
    dsLeft = CDbl([rsData]![ColumnAdj])
    dsWidth = CDbl([rsData]![zWidth])

    RptCtrl.Top = ((dsTop * (1 / 6))) * 1440

    RptCtrl.Left = ((dsLeft * (1 / 10))) * 1440
    RptCtrl.Width = ((dsWidth * (1 / 10))) * 1440
    RptCtrl.Height = 0.166667 * 1440

    RptCtrl.FontName = "Courier New"

    RptCtrl.FontSize = 12
    RptCtrl.ForeColor = 0
    RptCtrl.TextAlign = 1




More information about the AccessD mailing list