Option Compare Database
Dim sum1 As Currency
Dim sum11 As Currency
Dim sum111 As Currency
Dim sum2 As Currency
Dim lngA As Long
Dim row As Long
Dim RowsInPage As Integer
Private Sub 主体_Format(Cancel As Integer, FormatCount As Integer)
' RowsInPage = 25
' row = row + 1
' If row >= RowsInPage Then
' Me.PageBreak18.Visible = True
' row = -1
' Else
' Me.PageBreak18.Visible = False
' row = 7
' End If
End Sub
Private Sub 主体_Print(Cancel As Integer, PrintCount As Integer)
' sum1 = sum1 + Me.金额.Value
' sum11 = sum11 + Me.税额.Value
' sum111 = sum111 + Me.合计.Value
Dim lngRows As Long '设置第一页行数用
Dim lngRows2 As Long '设置第二页行数用
Dim lngRows3 As Long '设置第、二页总行数用
Dim intAllRows As Integer 'intAllRows 定义为包括空行,完整的行数。
Dim objCtl As Control
If intAllRows = 0 Then
If txtTotGrp Mod lngRows = 0 Then
intAllRows = txtTotGrp
Else
intAllRows = (Fix(txtTotGrp / lngRows) + 1) * lngRows
End If
End If
Debug.Print intAllRows
If lngA <= txtTotGrp Then
For Each objCtl In Me.Section(0).Controls
If objCtl.ControlType = acTextBox Then
With objCtl
.Visible = True
End With
End If
Next objCtl
Else
If lngA = intAllRows + 1 Then lngA = 1
For Each objCtl In Me.Section(0).Controls
If objCtl.ControlType = acTextBox Then
With objCtl
.Visible = False
End With
End If
Next objCtl
'设置第一条记录要显示出来
If lngA = 1 Then
For Each objCtl In Me.Section(0).Controls
If objCtl.ControlType = acTextBox Then
With objCtl
.Visible = True
End With
End If
Next objCtl
End If
End If
'以下设定是否进入下一节
If txtTotGrp < intAllRows Then
If lngA < txtTotGrp Then
Me.NextRecord = True
ElseIf (lngA >= txtTotGrp And lngA < intAllRows) Then
Me.NextRecord = False
Else
Me.NextRecord = True
End If
Else
Me.NextRecord = True
End If
End Sub