如何分页打印Access报表
Access报表打印——自动分页
问题:
每页打印一定行数后自动分页
方法一:
加一个分页符,在报表的代码界面里面写入以下代码:
方法二:
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.PageBreak18.Visible = True
row = -1
Else
Me.PageBreak18.Visible = False
End If
End Sub
在报表的代码界面里面写入以下代码:
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
学习电脑编程语言,请点 www.zzzyk.com《电脑教程》栏目
想学习更多电脑知识,就请继续关注站长资源库电脑知识网 www.zzzyk.com