<form id="hbx9t"></form>

<noframes id="hbx9t">

    <em id="hbx9t"><span id="hbx9t"></span></em>

        <noframes id="hbx9t"><address id="hbx9t"><th id="hbx9t"><progress id="hbx9t"></progress></th></address>
        office交流網--QQ交流群號

        Access培訓群:792054000         Excel免費交流群群:686050929          Outlook交流群:221378704    

        Word交流群:218156588             PPT交流群:324131555

        access設置報表的打印頁邊距

        2020-11-08 08:00:00
        tmtony8
        原創
        16014

        需要打印的報表,有一定的頁面格式。設置好格式,才能更好的打印到對應的紙張中。

        access設置報表格式, 設置指定的打印頁的邊距


        如下代碼。用TopMargin 與 LeftMargin、RightMargin 和 BottomMargin屬性起指定打印頁的邊距。

        其中因為單位為 緹(Twips),1cm= 567  Twips

        Private Sub 設置_Click()
            '沒有設置頁邊距或頁邊距設置錯誤時出錯
            On Error GoTo Err
               
            DoCmd.OpenReport "報表1", acViewPreview
            '設置報表“報表1”上邊距
            Reports("報表1").Printer.TopMargin = 上 * 56.7
            '設置報表“報表1”下邊距
            Reports("報表1").Printer.BottomMargin = 下 * 56.7
            '設置報表“報表1”左邊距
            Reports("報表1").Printer.LeftMargin = 左 * 56.7
            '設置報表報表1”右邊距
            Reports("報表1").Printer.RightMargin = 右 * 56.7
        If 0 Then
        Err:
            '出錯時打開錯誤提示
            MsgBox "頁邊距沒有設置完整或設置錯誤!"
        End If
        End Sub
        
          分享