Access Report Print - Automatic Page
problem:
Automatic paging after each page prints a certain number of lines
method one:
Add a pagination, write the following code in the code interface of the report:
Option Compare DatabaseDim row As LongDim RowsInPage As IntegerPrivate Sub body _Format (Cancel As Integer, FormatCount As Integer) RowsInPage = 7 row = row 1 If row> = RowsInPage Then Me.PageBreak18.Visible = True row = -1 Else Me. Pagebreak18.visible = false end ifend sub
Method Two:
Write the following code in the code interface of the report:
Option Compare DatabaseDim row As LongPrivate Sub body _Format (Cancel As Integer, FormatCount As Integer) row = row 1 If Me.Section (acDetail) .ForceNewPage = 1 Then Me.Section (acDetail) .ForceNewPage = 0 Else If row Mod 7 = 0 Then me.section (acdetail) .fornewpage = 1 row = 0 end if end ifend sub
Example download: http://access911.net/down/forcenewpage.rar