Batch reports and page numbers

  • Thread starter Thread starter Joan
  • Start date Start date
J

Joan

Can anyone tell me of a simple way to print a batch of Invoice Statements
(reports) where the page number will start over at 1 when a different
customer's invoice statement is printed? Currently, I have a textbox in the
page footer section of the report with the control source set to: ="Page "
& [Page] & " of " & [Pages]

This works fine, if I am printing out only one customer's invoice statement,
but when I print out a batch of invoice statements to various customers then
the page numbering is continuous for all of the invoice statements. The page
enumeration does not start over at 1 for each new customer and the [Pages]
number is the sum of all the pages for all of the customers' invoice
statements printed. Instead, I'd like [Pages] to be a number that is the
total number of pages for each customer.

There is nothing in the report header and report footer and there are no
group headers or group footers on the report. In the page header there are
controls for the Invoice Number and the Customer among others. The detail
section of the report contains 3 subreports. The line of code that opens the
report is:

DoCmd.OpenReport Report, ReportDest, , mysql

mysql is a string that is concatenated with a For/Next loop:

With ctlList
If .ListCount > 0 Then
For intIndex = 0 To InvCurrentItems
If mysql = "" Then
mysql = "("
Else
mysql = mysql & " or "
End If
mysql = mysql & "[Invoice Number] = " &
Forms![frmPrintReportsDialog]![Current Invoices].Column(0, intIndex)
Next intIndex
mysql = mysql & ")"
End If
End With

Any help with this is greatly appreciated!
Joan
 
You could just loop through a recordset and print out a report for each
customer
number, basically passing a where clause to OpenReport each time with the
current
customer number. You can download our batch reporting module and steal some
code
examples, if all you want to do is print each report to the printer you
don't really
need our product but later if you decide to instead make PDF files and push
them to a
web site or generate emails with attached pdf files you could then plug in
our functions.

HTH,
Mark
RPT Software
http://www.rptsoftware.com
 
Cheryl ,
Thanks so much for the link to the mvps.org article on "Printing First
and Last Page Numbers for Report Groups". It works beautifully and is so
much simpler than any of the other work- arounds that I've seen.
Joan



Cheryl Fischer said:
Here is a link to an article that will show you how to get your page
numbering the way you want it.

http://www.mvps.org/access/reports/rpt0013.htm

You will, however, need to create a group level on your report.

--
Cheryl Fischer
Law/Sys Associates
Houston, TX

Joan said:
Can anyone tell me of a simple way to print a batch of Invoice Statements
(reports) where the page number will start over at 1 when a different
customer's invoice statement is printed? Currently, I have a textbox in the
page footer section of the report with the control source set to:
="Page
"
& [Page] & " of " & [Pages]

This works fine, if I am printing out only one customer's invoice statement,
but when I print out a batch of invoice statements to various customers then
the page numbering is continuous for all of the invoice statements. The page
enumeration does not start over at 1 for each new customer and the [Pages]
number is the sum of all the pages for all of the customers' invoice
statements printed. Instead, I'd like [Pages] to be a number that is the
total number of pages for each customer.

There is nothing in the report header and report footer and there are no
group headers or group footers on the report. In the page header there are
controls for the Invoice Number and the Customer among others. The detail
section of the report contains 3 subreports. The line of code that opens the
report is:

DoCmd.OpenReport Report, ReportDest, , mysql

mysql is a string that is concatenated with a For/Next loop:

With ctlList
If .ListCount > 0 Then
For intIndex = 0 To InvCurrentItems
If mysql = "" Then
mysql = "("
Else
mysql = mysql & " or "
End If
mysql = mysql & "[Invoice Number] = " &
Forms![frmPrintReportsDialog]![Current Invoices].Column(0, intIndex)
Next intIndex
mysql = mysql & ")"
End If
End With

Any help with this is greatly appreciated!
Joan
 
You're welcome.


--
Cheryl Fischer
Law/Sys Associates
Houston, TX

Joan said:
Cheryl ,
Thanks so much for the link to the mvps.org article on "Printing First
and Last Page Numbers for Report Groups". It works beautifully and is so
much simpler than any of the other work- arounds that I've seen.
Joan



Cheryl Fischer said:
Here is a link to an article that will show you how to get your page
numbering the way you want it.

http://www.mvps.org/access/reports/rpt0013.htm

You will, however, need to create a group level on your report.

--
Cheryl Fischer
Law/Sys Associates
Houston, TX

Joan said:
Can anyone tell me of a simple way to print a batch of Invoice Statements
(reports) where the page number will start over at 1 when a different
customer's invoice statement is printed? Currently, I have a textbox
in
the
page footer section of the report with the control source set to:
="Page
"
& [Page] & " of " & [Pages]

This works fine, if I am printing out only one customer's invoice statement,
but when I print out a batch of invoice statements to various
customers
then
the page numbering is continuous for all of the invoice statements.
The
page
enumeration does not start over at 1 for each new customer and the [Pages]
number is the sum of all the pages for all of the customers' invoice
statements printed. Instead, I'd like [Pages] to be a number that is the
total number of pages for each customer.

There is nothing in the report header and report footer and there are no
group headers or group footers on the report. In the page header there are
controls for the Invoice Number and the Customer among others. The detail
section of the report contains 3 subreports. The line of code that
opens
the
report is:

DoCmd.OpenReport Report, ReportDest, , mysql

mysql is a string that is concatenated with a For/Next loop:

With ctlList
If .ListCount > 0 Then
For intIndex = 0 To InvCurrentItems
If mysql = "" Then
mysql = "("
Else
mysql = mysql & " or "
End If
mysql = mysql & "[Invoice Number] = " &
Forms![frmPrintReportsDialog]![Current Invoices].Column(0, intIndex)
Next intIndex
mysql = mysql & ")"
End If
End With

Any help with this is greatly appreciated!
Joan
 
Back
Top