首页 > 数据库 > Access > 正文

解读Access报表打印――自动分页

2020-07-13 12:26:05
字体:
来源:转载
供稿:网友

问题:

每页打印一定行数后自动分页

方法一:

加一个分页符,在报表的代码界面里面写入以下代码:

以下为引用的内容:
OptionCompareDatabase
DimrowAsLong
DimRowsInPageAsInteger
PrivateSub主体_Format(CancelAsInteger,FormatCountAsInteger)
  RowsInPage=7
  row=row 1
  Ifrow>=RowsInPageThen
    Me.PageBreak18.Visible=True
    row=-1
  Else
    Me.PageBreak18.Visible=False
  EndIf
EndSub

方法二:

在报表的代码界面里面写入以下代码:

以下为引用的内容:

OptionCompareDatabase
DimrowAsLong
PrivateSub主体_Format(CancelAsInteger,FormatCountAsInteger)
  row=row 1
  IfMe.Section(acDetail).ForceNewPage=1Then
    Me.Section(acDetail).ForceNewPage=0
  Else
    IfrowMod7=0Then
      Me.Section(acDetail).ForceNewPage=1
      row=0
    EndIf
  EndIf
EndSub

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表