問題:
每頁打印一定行數後自動分頁
方法一:
加一個分頁符,在報表的代碼界面裡面寫入以下代碼:
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