Page numbers in a report

G

Guest

I am creating invoices in report view and I have sorted/grouped the invoice
by vendor code. Each vendor has a unique code and I have about 40 vendors.
I would like the page number to start with 1 each time a new invoice is
created. I have a vendor code footer, page footer and report footer. Where
do I put the page number and how do I make it start from 1.

Thank you in advance for any help I can get

Pat
 
G

Guest

Few stages:

1. Create a Header for the Invoice field with the Sorting and Grouping
2. In the Invoice Header Force New Page select Before Section
3. In the report decleration declare a variable
Option Compare Database
Dim MyCount As Integer

4. In the OnFormat event of the invoice header write

MyCount = 1

5. In the Page Footer create a text box, UnBound

6. In the OnFormat event of the page footer write
PageNum = MyCount
MyCount = MyCount + 1
 
M

Marshall Barton

Pat said:
I am creating invoices in report view and I have sorted/grouped the invoice
by vendor code. Each vendor has a unique code and I have about 40 vendors.
I would like the page number to start with 1 each time a new invoice is
created. I have a vendor code footer, page footer and report footer. Where
do I put the page number and how do I make it start from 1.


Depending on what else you have in the report, just adding a
line of code to the vendor group header section's Format
event procedure might be sufficient:

Me.Page = 1
 
M

Marshall Barton

A very important point to keep in mind is that you should
**never** use code in report event procedures to count (or
sum) anything.

Because report sections are processed in whatever order and
as many times as necessary to deal with KeepTogether,
CanGrow, CanShrink, etc, counters in the Format and Print
events can produce results that are for all practical
purposes unpredicatable.
 

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