在页面页脚加入一个文本框控件,命名:本页合计
然后在报表模块中加以下代码:
Option Compare Database
Option Explicit
Dim mytotal
'以上是申明
Private Sub 页面页眉_Print(Cancel As Integer, PrintCount As Integer)
mytotal = 0 '每新开始一页即清零
End Sub
Private Sub 主体_Print(Cancel As Integer, PrintCount As Integer)
mytotal = mytotal + Me![销售数量] '统计
End Sub
Private Sub 页面页脚_Print(Cancel As Integer, PrintCount As Integer)
Me![本页合计] = mytotal '控件赋值
End Sub