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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing the same thing many times

Status
Not open for further replies.

McCloud77

Instructor
Jun 4, 2001
8
CA
Suppose I'm recieving items in different quantities. I give each item an ItemNumber unique to my job. I want to print labels to stick on those items. In my table I have the ItemNumber and the QTY of each item. Q: what to put in the report so as the label is printed many times (=QTY). QTY is always and integer.

Thanks folks ...
 
Hi!

Specify the number of copies in DoCmd.PrintOut!

Sub PrintLabels()
Dim intNumCopies as integer

intNumCopies = me!QTY
DoCmd.PrintOut , , , , intNumCopies
End Sub

Aivars
 
In the Print event of your details section you can use the following code to look at the Qty and decide to repeat or not.

If [Qty] = 0 Then
Me.NextRecord = True
Me.MoveLayout = False
Me.PrintSection = False
Else
If PrintCount < [Qty] Then
Me.NextRecord = False
End If
End If

That should do it. Aivars method works as well, but only on a part by part basis. Using my code you can take a query that has all your stuff and it will go through each one and print the number of copies you need.

HTH
Joe Miller
joe.miller@flotech.net
 
Thanks Aivars and Joe for responding. Before posting my inquiry, I was trying to do it in a similar method to Joe's but in the OnFormat Section. I used Joe's and worked so smoothly.

Thanks again ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top