設(shè)為首頁收藏本站Access中國

Office中國論壇/Access中國論壇

 找回密碼
 注冊

QQ登錄

只需一步,快速開始

每頁打印一定行數(shù)后自動分頁(報(bào)表分頁)

1970-1-1 08:00| 發(fā)布者: 佚名| 查看: 4580| 評論: 0

每頁打印一定行數(shù)后自動分頁

方法一: 加一個(gè)分頁符PageBreak1,在報(bào)表的代碼界面里面寫入以下代碼:
Option Compare Database
Dim row As Long
Dim RowsInPage As Integer
Private Sub 主體_Format(Cancel As Integer, FormatCount As Integer)
    RowsInPage = 7
    row = row + 1
    If row >= RowsInPage Then
        Me.PageBreak1.Visible = True
        row = -1
    Else
        Me.PageBreak1.Visible = False
    End If
End Sub


方法二:

在報(bào)表的代碼界面里面寫入以下代碼:
Option Compare Database
Dim row As Long
Private Sub 主體_Format(Cancel As Integer, FormatCount As Integer)
    row = row + 1
    If Me.Section(acDetail).ForceNewPage = 1 Then
        Me.Section(acDetail).ForceNewPage = 0
    Else
        If row Mod 7 = 0 Then
            Me.Section(acDetail).ForceNewPage = 1
            row = 0
        End If
    End If
End Sub

最新評論

QQ|站長郵箱|小黑屋|手機(jī)版|Office中國/Access中國 ( 粵ICP備10043721號-1 )  

GMT+8, 2025-7-17 00:32 , Processed in 0.072143 second(s), 17 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

返回頂部