Problem:
|
Automatically pagination after printing a certain number of lines per page |
Method One:
|
Add a page break and write the following code in the report's code interface:
Option Compare Database Dim Row as Long Dim Rowsinpage as Integer Private Sub principal _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 If End Sub |
|
Method II:
|
Write the following code in the Code interface of the report:
Option Compare Database Dim Row as Long Private Sub principal _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). ForceNewPage = 1 Row = 0 End If End If End Sub |
|
Example Downloads:
Http://access911.net/down/ForceNewPage.rar