Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Reports Two Copies
Donald Parker 
   
3 years ago
I created a print preview button with the wizard on my invoice entry form. It prints the current invoice using the where condition "="[caseno]=" & "" & [caseno] & """. It's the only way I have found to be able to bring up the printer properties and select two copies to be printed. This adds extra steps. I would like to have a print button that automatically prints two copies of the current record. I am no professional Access developer here so simple or detailed is best for me. Anyone have an idea??? Just so you know ahead of time, I did try VBA using the following code I got from ChatGPT. It did not work.


Private Sub Command31_Click()
    ' Print two copies of the current record without preview
    Dim strWhere As String
    
    ' Get the value of the caseno field for the current record
    strWhere = "[caseno] = " & Me![caseno]
    
    ' Open the report with the specified criteria
    DoCmd.OpenReport "InvoicePrntR", acViewNormal, , strWhere
    
    ' Print two copies without showing the print preview
    DoCmd.PrintOut , , , acPrintAll, 2
    
    ' Close the report
    DoCmd.Close acReport, "InvoicePrntR"
End Sub
Adam Schwanz  @Reply  
           
3 years ago
You should just be able to do
docmd.OpenReport "InvoicePrntR",,,"CaseNo=" & CaseNo
and have it automatically print out the report, so you should just be able to double it to get 2 copies.
docmd.OpenReport "InvoicePrntR",,,"CaseNo=" & CaseNo
docmd.OpenReport "InvoicePrntR",,,"CaseNo=" & CaseNo
Richard Rost  @Reply  
          
3 years ago
ChatGPT is pretty good... but not perfect. It put you on the right path, but it gave you the parameters for PrintOut wrong. It should be:

DoCmd.PrintOut Copies:=2

I actually have this command on my list for a TechHelp video, so stay tuned.
Donald Parker OP  @Reply  
   
3 years ago
Adam, I added another action repeating the first in the macro and it worked perfectly. Should have thought of that myself. Could not find any instructions on how to just add another where condition without adding another action though. Thank you.

But something is wrong Richard. I also tried yours and it printed out the first copy fine then proceeded to print out the rest of the records in the table on pages with large blocked out areas in grey. I took a picture of the output, but I don't see a way to add it to this reply. Other than that, with Adam's reply above everything works perfectly.
Donald Parker OP  @Reply  
   
3 years ago
Just so you know Richard, I had been working on this for two months learning Access. Been hobbling along on my old Alpha software database and computer while I did this. LOL! The very day I got everything working fine in Access the Alpha software quit working and the next day so did the computer. God was surely involved here. My old tables, which I was able to to export to Excel turned out to be corrupted or some such incompatibility with my new tables in Access. So I was only able to get the last few months transferred after some maintenance in Excel. But that's not really a problem. I rarely need to look something up from the past and I can still do it with the Excel tables. Anyhow, I owe you a huge thank you for the work you've put in on this web site. I could not have done it without you. Thank you.
Donald Parker OP  @Reply  
   
3 years ago
Hmmmm ... I just noticed the colon after the Copies in "DoCmd.PrintOut Copies:=2" That's probably what I did wrong on yours Richard. Anyhow, adding the second action on the macro worked so I'm leaving it alone LOL!
Richard Rost  @Reply  
          
3 years ago
Glad you got it working, Donald. You can't attach a photo directly inside a reply once you start typing, but if you look at the bottom of the reply thread before you start typing and it goes red, you'll see that there's a link there that says "upload a photo." Right now it's two steps. I'm going to make it one step in the future; I just have to work on it a little bit more. And yeah, that little colon is necessary. That's called a named argument.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access 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: 5/6/2026 6:24:30 AM. PLT: 1s