Solved

How do I make a print all reports button that prints all reports that have data in them?

Posted on 2011-02-19
16
326 Views
Last Modified: 2012-05-11
I have an Access 2003 report that has a lot of reports on it.  I have to print them one at a time.  I would like to create a print all button that only prints the reports that have data in them. PROSEP-DYPROTEC-Backup.zip
0
Comment
Question by:datadigi
  • 9
  • 7
16 Comments
 
LVL 3

Expert Comment

by:DockieBoy
ID: 34935214
Are you looking to add a button to the Form "frmReportDialog" that will print every report?
0
 

Author Comment

by:datadigi
ID: 34935240
yes, I am.
0
 

Author Comment

by:datadigi
ID: 34935253
I have to go and pick up my daughters now.  I will be gone for about 30-40 minutes and then back.
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 3

Expert Comment

by:DockieBoy
ID: 34935260
Add a button to that form and code it as follows;

Private Sub Mybutton_Click()
 Dim rpt as Object
  For Each rpt in Application.CurrentProjec.AllReports
  DoCmd.OpenReport rpt.name, acViewNormal
 Next rpt
End Sub

To only print reports with data you could set the criteria in the query for each report to exclude Null values And/Or Zero Length Strings.
0
 

Author Comment

by:datadigi
ID: 34935507
I'm back.  I will try it out!
0
 

Author Comment

by:datadigi
ID: 34935516
could you just give me the database?
0
 
LVL 3

Expert Comment

by:DockieBoy
ID: 34935541
I have not changed any queries to filter out Null values or zero length strings as I am unsure as to what data is a requirement.

 PROSEP-DYPROTEC-Backup.zip
0
 

Author Comment

by:datadigi
ID: 34935549
I am still unsure of what to do...
0
 
LVL 3

Expert Comment

by:DockieBoy
ID: 34935559
Hmm, ok, sorry, but I will need to start from the top.

Presently you select the reports option from the switchboard and the reports form opens.  You then click on one of the report options and the report will print?
0
 

Author Comment

by:datadigi
ID: 34935574
presently I go to the switchboard and select print a report.  then it goes to the FrmReportDialog.  From there I have to click the reports one at a time to print.  What I want is a print all button added that will print all of the reports.  Preferably only the ones that have data in them, but if it is a big deal then I can throw those away...  
0
 
LVL 3

Expert Comment

by:DockieBoy
ID: 34935589
Ok, so when you open the db that I sent back and go to the FrmReportDialog form, can you see the new label with the blue writing that says "Print All Reports" ?
0
 

Author Comment

by:datadigi
ID: 34935622
database that you sent back? I didn't get a database back.
0
 
LVL 3

Accepted Solution

by:
DockieBoy earned 500 total points
ID: 34935631
Lol, ok, strange, it shows up in my post at my end. Should be an attachment to post Id: 34935541
0
 

Author Comment

by:datadigi
ID: 34935661
oh lol,  the one at the beginning!
0
 

Author Closing Comment

by:datadigi
ID: 34935680
Thank you
0
 
LVL 3

Expert Comment

by:DockieBoy
ID: 34935698
Another alternative is to change the on click event of the new label I created to "mfrmDialogGroup", this will run the whole macro group that the other labels run specific macros from.

Happy to help
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question