|
代码如下(有更改):
Option Compare Database
Dim aaa As Long '行数
Private Sub Report_Open(Cancel As Integer)
aaa = InputBox("请输入固定的行数[试用建议1-6]", "请输入行数", 3)
End Sub
Private Sub 主体_Format(Cancel As Integer, FormatCount As Integer)
If Me.counter Mod aaa = 0 Then '每隔aaa行分页
Me.PageBreak9.Visible = True
Else
Me.PageBreak9.Visible = False
End If
End Sub
Private Sub 主体_Print(Cancel As Integer, PrintCount As Integer)
Dim CtlDetail As Control
Dim intLineMargin As Integer
intLineMargin = 60
For Each CtlDetail In Me.Section(acDetail).Controls
With CtlDetail
If CtlDetail.ControlType <> acPageBreak Then
If CtlDetail.Name <> "Memo" Then
Me.Line ((.Left + .Width + intLineMargin), 1)-(.Left + .Width + _
intLineMargin, Me.Height)
End If
End If
End With
Next
With Me
Me.Line (1, 1)-Step(.Width, .Height), 1, B
End With
Set CtlDetail = Nothing
End Sub
|
|