button to export all reports?

tomas_s

Registered User.
Local time
Today, 11:58
Joined
Mar 12, 2013
Messages
25
So i have this database

by the way, hello, yes Im new.. :)

I have this database with almost 10 reports (one report per table) that you can export or print. But I would like to have a button to export or print ALL the reports. Because when I try to build a report with all columns, access won't let me and suggests that I try with fewer columns or fields.

So naturally (after cursing and bursting with rage) :banghead:I can only think of the solution to make a button that exports or prints all the reports.

any suggestions, or at least directions. Oh and please keep it as simple as possible, im not on "script-programming" level. My database is created with point and click actions from my side.
 
If you have subreports anywhere you should name the reports you want to be able to run automatically with a prefix like rpt_

So then you can use this code (and it won't output reports that aren't wanted):
Code:
Dim varItem As Variant
 
For Each varItem in CurrentProject.AllReports
   If Left(varItem.Name, 4) = "rpt_" Then
       DoCmd.OpenReport varItem.Name, acViewNormal
   End If
Next

That will print them all. The export would be similar but use the appropriate command to run the export.
 

Users who are viewing this thread

Back
Top Bottom