Help with page numbers

hullstorage

Registered User.
Local time
Today, 19:56
Joined
Jul 18, 2007
Messages
213
hi there

i have a report based on a query where all my records are printed based on where the invoice field = "no"

then i have a button to print these

i am trying to put a page number on the report so if there are 3 pages for a given customer it would be like 1of3 2of3 3of3 then the same for the next customer

but the problem i have is when i print all the invoices i am getting 1 of 20 2 of 20 etc on all of the customers reports

what am i doing wrong
 
What method are you using to do the page numbering. Access only knows the simlpe method of numbering until the end of the report.

Take a look here for a good method.

The method is straight forward. Do note that although the method uses a new text box to display the page numbering, you need to keep the original "Page n of m" box (although you can hide it).

When you copy in the code, make sure the Page Footer On Format event is created properly (go into the page footer properties and check the event). It may be that you have to create the event then copy the code into the event sub.

hth
Chris
 
Hi there

thanks for the reply, the problem i have is that i have never used modules could you explain where and how i use this

thanks
 
Just right-click in the footer bar in your report design view and select properties.

Then click on the events tab and click on the On Format event.

Then you will see three dots appear on the right hand side of the line. click on the three dots and select Code Builder in the next window.

You should see Private Sub and End Sub statements in the code window. Just copy/paste the same section from the link between these statements.

Then copy the bit above the Private Sub statement from the link and paste it above the Private Sub statement in your code window (delete anything else that was there before.

So the code in your window should look the same as the link (except the PageFooter might be referenced slightly differently but that's fine).

Now, as per the links instructions, you have to change the line that makes reference to the group level you wish to renumber at.

Don't forget you need to have added a new text box in the footer (see the link instructions) as well as the Pgae n of m one.

hth
Chris
 

Users who are viewing this thread

Back
Top Bottom