Print and add an example, automatic paging

Source: Internet
Author: User

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







Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.