Print the same record twice

  • Thread starter Thread starter Bill Phillips
  • Start date Start date
B

Bill Phillips

I need to print labels for products I ship out. A customer
may order 2 cases of product A and 3 cases of product B.
Subsequently I need 2 & 3 labels respectively. I would
like to query the order file and create a column called
LabelQty that passes a parameter to the report telling it
how many of each label to print.

I'm fairly sure I can do this with an On Format event in
the Detail section, but I just can't figure out the code.
Any help or references will be greatly appreciated.
 
Bill said:
I need to print labels for products I ship out. A customer
may order 2 cases of product A and 3 cases of product B.
Subsequently I need 2 & 3 labels respectively. I would
like to query the order file and create a column called
LabelQty that passes a parameter to the report telling it
how many of each label to print.

I'm fairly sure I can do this with an On Format event in
the Detail section, but I just can't figure out the code.


I can think of two ways to approach this issue. The one you
asked about is to keep a counter variable in the detail
section's Format event procedure and use that to control the
report's MoveNext property. I don't feel very comfortable
using an event procedure counter.

Another way is to create a table named NumCopies with one
field named Qty. Populate the records in the table with
consecutive numbers from 1 to more than you ever need for
duplicate labels. Then add that table to the report's
record source query without any join line between the two
tables and a criteria that limits the Qty field to the
number of cases ordered. E.g.

SELECT Orders.*, NumCopies.Qty
FROM Orders, NumCopies
WHERE Orders.OrderDate Between [Start] And [End]
AND NumCopies.Qty <= Orders.NumCases

This will provide the label report with the appropriate
records so that report does not have to be concerned with
duplicating anything.
 
Back
Top