Printing specified numbers of labels

cricketbird

Registered User.
Local time
Today, 02:14
Joined
Jun 17, 2013
Messages
125
From selected record(s) in a listbox, I would like to print multiple mailing labels (stickers). So, if someone enters "5" on the form, it would print 5 identical labels per record. If they enter 300 labels, it should print 300 labels per selected record.

I can easily print 1 label each of the selected records, but I assume I need to join to an array or something with the numbers 1 through X or something to get the specified number of repeats. Does anyone have an example of how this would work? Thank you!
 
I would use a Tally table that contains sequential numbers and then use a cartesian join query to produce the number of labels/records you need. For example:
SQL:
SELECT ClientName, Address FROM TableName, TallyTable WHERE TallyTable.Seq <= 5
 
I'm trying to decide if that is extraordinarily cludgy or extremely elegant, but it works, so I'll go with it. Thank you!
 
I'm trying to decide if that is extraordinarily cludgy or extremely elegant, but it works, so I'll go with it. Thank you!
Tally tables have a lot of use in a database, so you will hear it mentioned a lot. Good luck with your project.
 
I'm trying to decide if that is extraordinarily cludgy or extremely elegant, but it works, so I'll go with it. Thank you!
Elegant. It is a novel way of using a cartesian join.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom