打印再添一例,自动分页

时间:2009-07-11 01:44:56   来源:第二电脑网  作者:第二电脑网

  第二电脑网导读:ivate 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 方法二: 在报表的代码界面里面写入以下代码: Optio...
  正文:


问题:

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

方法一:
 

加一个分页符,在报表的代码界面里面写入以下代码:
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

例子下载:
http://access911.net/down/ForceNewPage.rar




来源:http://www.002pc.com/master/College/Database/Access/2009-07-11/10019.html

收藏到:

关于《打印再添一例,自动分页》文章的评论

共有 0 位网友发表了评论 此处只显示部分留言 点击查看完整评论页面

随机文章

    SQL Error: select * from ***_ecms_article where classid='98' and checked=1 order by rand() limit 10

顶出来的热门

    SQL Error: select * from ***_ecms_article where classid='98' and checked=1 order by diggtop desc,id desc limit 10
站内搜索: 高级搜索

热门搜索: Windows style 系统 tr IP QQ CPU 安装 function 注册 if td