問題:
每頁打印一定行數(shù)后自動(dòng)分頁
方法一:
加一個(gè)分頁符,在報(bào)表的代碼界面里面寫入以下代碼:
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
方法二:
在報(bào)表的代碼界面里面寫入以下代碼:
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
更多信息請查看IT技術(shù)專欄