在报表中插入三个无关联的文本框控件,取名分别为Text,Text2,Text3,他们的宽/高,上/左边距按需求自定义,可见均设置为否,如果你需要显示序号的话,text3可设置为可见
text 控件来源: =1
text 2:控件来源: =IIf([Text]<[Text3]+1,[Text],IIf(([Text] Mod [Text3])=0,[Text3],([Text] Mod [Text3])))
以设置打印10行为例,把下面代码复制到报表中
Option Compare Database Option Explicit Dim row As Long Dim RowsInPage As Integer Dim x As Integer Private Sub Report_Load() x = OpenArgs End Sub
Private Sub 主体_Format(Cancel As Integer, FormatCount As Integer) Dim x As Integer x = 10 Me.Text3 = 10 If Me.Text Mod x = 0 Then Me.主体.ForceNewPage = 1 Else Me.主体.ForceNewPage = 0 End If End Sub
打印事件调用代码如下:
'打印报表 DoCmd.OpenReport "刀具申领单", acViewNormal, , "单据编号 = " & ToAddString(DH) '后面这个参数是字段过虑
别问我为什么,我也不知道,反正能实现需求
标签:Me,Dim,Sub,控件,ACCESS,分页,Integer,报表 From: https://www.cnblogs.com/yoooos/p/17744558.html