This Access tutorial explains how to add page break by Group in Access Report and add blank page if last page is odd number.
Access Report page break by Group
When we create Access Report which has different grouping, we may want to start a new page for each group.
Assume that we have the following Report grouped by Department and Section. How do we start a new page for each Department?
First, go to the Design View of the Report. As you can see at the bottom, it is grouped by Department and then grouped by Section.
Click on Dept Header, in the Property page, set the Force New Page property to Before Section
Alternative, click on the Dept Footer, in the Property page, set the Force New Page property to After Section. Do not use After Section in Access 2010 because it is bugged to give blank pages, use Before Section instead.
Now go to Print Preview and you will see Access starts a new page for each Department.
Access Report add blank page if last page is odd number
If we are going to distribute each report to each department, we cannot have page 1 for department A and page 2 for department B, instead you can print single side.
To print double side, if the end page of department A is odd page, we need to insert a blank page, so that we have department A in page 1, blank page 2, department B in page 3.
Now go to Design View, under Dept Footer, insert a Page Break Control, say PageBreak49.
Next, click on Depart Footer, in the Property, select Event > On Format > Code Builder
Insert the following code
If Me.Page Mod 2 = 0 Then
Me!PageBreak49.Visible = False
Else
Me!PageBreak49.Visible = True
End If
Go to Print Preview. Now Finance Department are in Page 1 and 2. Since the last page is even number, PageBreak49 is invisible (no page break).
For HR Department, since the last page is odd number, PageBreak49 becomes visible (add page break).
Outbound References
Access Report page break by Group and add blank page
沒有留言:
張貼留言