G
Guest
I routinely print labels to pack our products for shipping. If I need to
pack 10 items for an order, each in its own bag, I use a table called "num"
to create 10 labels for me, each showing: 1 of 10, 2 of 10, etc. The help
came from John Vinson, and it has be very useful. Now if possible I would
like to refine it a bit more.
Occassionally, based on the size of the items I could pack them in 2's, so
I would want a total of 5 labels, printed as 1-2 of 10, 3-4 of 10 etc. or
even in groups of 5 creating just 2 labels 1-5 of 10 and 6-10 of 10.
I would like to add a field to my label which asks the user for number in a
package. The program would then do the math as discribed above and create
the appropriate number of labels. Can this done? Any help is greatly
appreciated.
Lele
I have reprinted John's original response below:
An auxiliary table is handy for this purpose. I routinely put a table
named Num, with one Integer (or Long Integer) field N as its primary
key. I originally created the table (I just import it now) in Excel
with fill-down sequential, with numbers from 1 to 10000.
Create a Query for your report with whatever tables you need; include
the Num table with (initially) a Join from from the Quantity field to
N. Then open the query in SQL view and edit the line
INNER JOIN Num ON Num.N = yourtable.quantity
to
INNER JOIN Num ON Num.N <= yourtable.quantity
This "non equi join" query will give you as many repeats as the value
of quantity for each row. You can use N as the control source of the
"1 of" textbox, and [quantity] as the control source of the "of 5"
textbox.
pack 10 items for an order, each in its own bag, I use a table called "num"
to create 10 labels for me, each showing: 1 of 10, 2 of 10, etc. The help
came from John Vinson, and it has be very useful. Now if possible I would
like to refine it a bit more.
Occassionally, based on the size of the items I could pack them in 2's, so
I would want a total of 5 labels, printed as 1-2 of 10, 3-4 of 10 etc. or
even in groups of 5 creating just 2 labels 1-5 of 10 and 6-10 of 10.
I would like to add a field to my label which asks the user for number in a
package. The program would then do the math as discribed above and create
the appropriate number of labels. Can this done? Any help is greatly
appreciated.
Lele
I have reprinted John's original response below:
An auxiliary table is handy for this purpose. I routinely put a table
named Num, with one Integer (or Long Integer) field N as its primary
key. I originally created the table (I just import it now) in Excel
with fill-down sequential, with numbers from 1 to 10000.
Create a Query for your report with whatever tables you need; include
the Num table with (initially) a Join from from the Quantity field to
N. Then open the query in SQL view and edit the line
INNER JOIN Num ON Num.N = yourtable.quantity
to
INNER JOIN Num ON Num.N <= yourtable.quantity
This "non equi join" query will give you as many repeats as the value
of quantity for each row. You can use N as the control source of the
"1 of" textbox, and [quantity] as the control source of the "of 5"
textbox.