Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MULTIPLE MAILING LABELS

Status
Not open for further replies.

Rjconrep

Technical User
Oct 24, 2000
66
US
I am creating a mailing label from an orders table. Within the orders table there is a field "Quantity" and amongst others "Customer".

A customer may order a quantity of say 3. This results in the need to print out 3 labels (to go on a box for mail-out) and on each label print "Box 1 of 3", "Box 2 of 3" etc.

How can this best be achieved, given that there is only one record in the orders table?
 
Place this code in the OnPrint event of the detail section of your report:
[tt]
If [Quantity] = 0 Or IsNull([Quantity]) Then
Me.NextRecord = True
Me.MoveLayout = False
Me.PrintSection = False
Else
If PrintCount < [Quantity] Then
Me.NextRecord = False
End If
End If
[/tt]

That looks at the field quantity and will repeat the printing of the record until the quantity has been reached. Now place another unbound textbox on your form, name it txtPrintCount, and set it's control source to this:

=[PrintCount]

And finally, use this in the control source of another unbound textbox to give you your &quot;Box x of y&quot;:

=&quot;Box &quot; & [txtPrintCount] & &quot; of &quot; & [Quantity]

HTH Joe Miller
joe.miller@flotech.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top