Computer Learning Zone CLZ Access Excel Word Windows

One glance at a book and you hear the voice of another person, perhaps someone dead for 1,000 years. To read is to voyage through time.

-Carl Sagan
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Visitor Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Printing Labels and Reports
patrick stienaers 

9 months ago
Hi,
I was wondering of there is a possibility to print a report or label a certaim number of times, based on a value that you would put in to that report or label.
Sami Shamma  @Reply  
             
9 months ago
Yes, I do that all the time.
Using VBA, I will call the report from inside a loop from 1 to NumberOfCopies
Adam Schwanz  @Reply  
           
9 months ago
Sure, there are a number of ways you could do it. I'll include one that I've used at a location that prints labels out on like Avery 5160 label paper. They use a form to select a part from, and enter a Qty. Might give you some ideas at least.

It uses 2 tables, the part/qty information goes into my SingleLabelT (from the form) and the code lists out the parts in SingleLabelRT that the report is based on. So if I put qty 3, then the code will add 3 records for that part (thus getting 3 labels on the report).

Dim X As Integer, MaxRec As Integer
            
    Me.Refresh
    
    Dim DB As Database
    Dim RS As Recordset, rs2 As Recordset
    Set DB = CurrentDb()
    Set RS = DB.OpenRecordset("SingleLabelT")
    Set rs2 = DB.OpenRecordset("SingleLabelRT")
    While Not RS.EOF
            MaxRec = RS!Qty
        For X = 1 To MaxRec
            rs2.AddNew
            rs2!PartNum = DLookup("PartNum", "PartsT", "PartID=" & RS!PartNum)
            rs2!Description = DLookup("Description", "PartsT", "PartID=" & RS!PartNum)
            rs2!BinLocation = DLookup("BinLocation", "PartsT", "PartID=" & RS!PartNum)
            rs2.Update
        Next
        RS.MoveNext
    Wend
    RS.Close
    DB.Close
    Set RS = Nothing
    Set DB = Nothing
    
    CurrentDb.Execute "DELETE * FROM SingleLabelT"
        
    DoCmd.OpenReport "SingleLabelR", acViewReport, "", "", acNormal
    Me.Requery
    
    CurrentDb.Execute "DELETE * FROM SingleLabelRT"
Adam Schwanz  @Reply  
           
9 months ago
And yea, I may have misunderstood the question :P. If it's the full report then just loop through as Sami said and keep re-printing. I'll leave my other post here in case it's more similar to what you're trying to do.
Raymond Spornhauer  @Reply  
          
9 months ago
You will probably need to use the 'Sleep' function in your loop to prevent the code from running so fast the printer doesn't see it.

-Raymond

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Visitor Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 6/20/2026 6:41:58 PM. PLT: 0s