How do I specify the number of times a record is printed based on.

N

Ngan

Hi,
I have 2 fields in a table: Item & Qty. I'm doing a Label Report based on
this table. How do I tell the report to print the number of Items based on
its Qty. For EX, if Qty is 5, I want to print that Item 5 times. I thought
about doing a VBA code to modify the table, but is there a simpler way?
Thanks
-ngan
 
M

Marshall Barton

Ngan said:
I have 2 fields in a table: Item & Qty. I'm doing a Label Report based on
this table. How do I tell the report to print the number of Items based on
its Qty. For EX, if Qty is 5, I want to print that Item 5 times. I thought
about doing a VBA code to modify the table, but is there a simpler way?


Create a table named Numbers with one field named NumCopies.
Populate the table with consecutive numbers 1,2,3,... to
more than the maximum quantity you'll ever have.

Now you can create a query to use as the label report's
record source:

SELECT Sales.Item , Sales.Qty,
Numbers.NumCopies As ItemNumber
FROM Sales INNER JOIN Numbers
ON Numbers.NumCopies <= Sales.Qty
 
Top