Reset Page number on group level in a report

A

All ok

Refering to the solution given in ACC2000 below.

How to Move the control called Page Number, which displays
the page number, to the Page Header ?

Right now report is displaying the page nubers except for
the last page which is showing "0". I believe this is
because of error in executing the last step of the given
solution which is to move control. Kindly help !



ACC2000: How to Reset the Page Number on Group Level in a
Report
View products that this article applies to.
This article was previously published under Q209215
Moderate: Requires basic macro, coding, and
interoperability skills.

This article applies to a Microsoft Access database (.mdb)
and to a Microsoft Access project (.adp).


SUMMARY
By modifying a report's section properties, you can design
a report that breaks the page for each new entry in a
group and resets the report's page number. For example, in
Microsoft Access 2000, the Employee Sales by Country
report in the sample database Northwind.mdb is designed
with this feature.
MORE INFORMATION
NOTE: The method used to reset the page number for each
new country depends on whether you want to display the
page number in the page header or page footer. If you use
the wrong method, the page number is not reset correctly.
Method 1: The Page Number Is Displayed in the Page Footer
Start Microsoft Access and open the sample database
Northwind.mdb or the sample project NorthwindCS.adp.
Open the Employee Sales by Country report in Design view.
Click the Country Header section, and then click the Build
button (on the Standard toolbar) for the OnFormat property
to examine the event procedure.
Click the Country Footer section, and then set the
ForceNewPage property to After Section.
Method 2: The Page Number Is Displayed in the Page Header
Start Microsoft Access and open the sample database
Northwind.mdb or the sample project NorthwindCS.adp.
Open the Employee Sales by Country report in Design view.
Click the Country Footer section, click the Build button
for the OnFormat event, select Code Builder, and then
click OK. In the code window type the following:
Page = 0

Change the On Format event of the Country Header so that
the Page property is not set in this event; do this by
typing an apostrophe before the line with the starting
page number. The code should then closely resemble the
following:private Sub GroupHeader0_Format(Cancel As
Integer, FormatCount As Integer)
' Set page number to 1 when a new group starts.
' Page = 1
End Sub

Click the Page Header section, set the Height property to
0.25, and then set the Back Color property to 8421504.
Move the control called Page Number, which displays the
page number, to the Page Header.
When you use either of these methods, each country begins
on a new page, and the numbering of each new section
begins with the number 1.
 
M

Marshall Barton

All said:
Refering to the solution given in ACC2000 below.

How to Move the control called Page Number, which displays
the page number, to the Page Header ?

Right now report is displaying the page nubers except for
the last page which is showing "0". I believe this is
because of error in executing the last step of the given
solution which is to move control.


I have no idea how you're getting a 0 page number, but you
can move controls around a report's design space by just
dragging and dropping with the mouse.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top