Report Label Help Please

T

TJ

I have a Report formatted as an Avery Label 5160 which is 30 labels per
sheet. When the Report is called, it has to deal with a Field "Comp Part"
and a Field named "Change-over Qty" from a Table named "Customer Inv" to
know how many labels of that Comp Part to print. If the Comp Part and
quantity are only listed once in the table, then all is OK and I end up
with the right quantity of labels. If there are multiple entries in the
table for the same part number and quantities because that's the way they
were manually entered, then some of the labels do not print because the
total count is off.

I believe it has to do with some code called when the label prints.

The Header of this report is sequenced off of a Field named SEQ in the
Table. The On Format property of the Header Section has:
=SetCount()

The On Print property in the Detail section of the report has this entry:

=LabNumb([Reports]![Pad Labels])

Here is the code for the above:

Function LabNumb(R As Report)
Count = Count + 1
On Error Resume Next
If Count < R.[LabNumb] - 1 Then
R.NextRecord = False
End If
End Function

Can someone assist with some code that will print multiple labels for a
single Comp Part with multiple quantities and be able to add up potential
multiple entries and quantities of the same Comp Part and be able to print
across multiple sheets of Avery 5160s.

Thanks much!
 
A

Allen Browne

Although the code you used is often suggested and even printed in Access
books, it does indeed fail under some circumstances.

The safer approach is to generate the correct number of records in a query,
via a Cartesian Product. Details in article:
Printing a Quantity of a Label
at:
http://allenbrowne.com/ser-39.html

Note that with this solution, if you do have multiples of the same record,
you will get the sum of them. For example, if you asked for 8 labels for
Fred, and then another record asks for 3 labels for the same Fred, you will
get 11 labels for Fred.
 
T

TJ

Allen,

Thanks for the tip....I believe this is going to do what I am after.

Thanks again!

Tom
 

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