Printing multiple report copies problem

D

DBenedict

Various reports started printing odd numbers of copies a few months back and
I'm not sure how to rectify the problem. I have multiple databases/reports
that have the same copy structure and all have this problem. Incidently,
this worked well for a couple years then something went wrong. Probably all
the upgrades to the network and/or Windows XP. We are now on SP3 with
Access 2003.
When a report runs, you are prompted for the number of labels you want.
Problem is, when I enter 1, I get one. When I enter 2, I get three. Then
everything 3 and above gives me one less label. So 3 gets me two, 4 gets me
three, 5 gets me four and so on. Its quite annoying!!!

Each report has a Text Box called [RepeatCounter] and its Control Source is
=[How many labels?]. In the Detail Section of the report, the OnPrint
property has this code.

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Static intMyPrint As Integer

Me.PrintSection = True
Me.NextRecord = True
intMyPrint = intMyPrint + 1
If IsNull([RepeatCounter]) Then
ElseIf intMyPrint Mod [RepeatCounter] = 0 Then
Me.NextRecord = True
intMyPrint = 0
Else
Me.NextRecord = False
End If
End Sub

Why did this work for so long and is now acting up? How can I get it to
function again?

Some reports use a macro with the OpenReports action, View is Print and
Window Mode is Normal. Some reports use a button on a form with the line
DoCmd.OpenReport stDocName, acViewNormal.

I want it to be automated. I could change everything to Print Preview and
then <Ctrl>+<P> and select my own number of copies but that defeats the
purpose.

I had a few Combo Boxes that went blank and wouldn't show it results after
the SP3 upgrade but I fixed that with a Hot Fix for XP Service Pack 3. The
fix solved the Combo Box issue but did not help this problem.

Any ideas to fix this?
 
A

Allen Browne

Using the report events has never been reliable.

Here's an alternatiave approach:
Print a Quantity of a Label
at:
http://allenbrowne.com/ser-39.html

It uses a Cartesian Product query to generate a record for each label, so no
code is needed in the report.

The article assumes you have a field that tells how many of each label you
want. If you want to just pop up a parameter box instead, then drop the box
out of the report, and put it in the query instead.

(You don't actually have to change any steps: if you don't have a field
named Quantity, then the query will pop up a box asking for the parameter
when you run the report.)
 

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