Print all reports with one command button

Mike Hughes

Registered User.
Local time
Today, 23:16
Joined
Mar 23, 2002
Messages
493
Would someone please tell me if is possible to print all reports in the database from one control button on a form? I currently print full company reports and worker specific reports, but to do it I must select a report and click on the print button then go back and select another report and print again. For the worker report it is a similar process with a few added steps. So I actually have two different situations where I want to print all reports.

1). Right now, to print a company wide (includes all workers) report, the user selects the radio button beside the name of the report and then clicks on a print button. Here is what the code looks like:

Private Sub cmdPRINT_Click()
Dim strReport As String

Select Case fraReports
Case 1:
strReport = "APPROVALS"
Case 2:
strReport = "APPROVED ADDITIONAL CONDITIONS"
Case 3:
strReport = "APPROVE/DENY COMBO"
Case 4:
strReport = "APPROVE/DENY OPTION 1"
Case 5:
strReport = "DENIALS"
Case 6:
strReport = "DENIALS WITH OPTION 1"
Case 7:
strReport = "REVIEW CONTINUANCES"
Case 8:
strReport = "TIME AGING"
Case 9:
strReport = "DISABILITY APPLICATIONS"
Case 10:
strReport = "REVIEW DISCONTINUANCES"
Case 11:
strReport = "SIX MONTHS OR OLDER"
Case 13:
strReport = "WITHDRAWN APPLICATIONS"
Case 14:
strReport = "DECEASED"
End Select

DoCmd.OpenReport strReport, acViewNormal
End Sub

2). Right now, to print a worker (includes all workers) report, the user selects the radio button beside the name of the report (same radio buttons used for full company reports shown in 1) above) the user then selects a worker name from a combo box and then clicks on a print button. Here is what the code looks like:

Private Sub cmdPrintSpecialist_Click()
'THIS IS TO PRINT SPECIALIST SELECT REPORTS

Dim strReport As String
Dim strLinkCriteria As String
strLinkCriteria = "Specialist = '" & cmbSpecialist & "'"


Select Case fraReports
Case 1:
strReport = "APPROVALS"
Case 2:
strReport = "APPROVED ADDITIONAL CONDITIONS"
Case 3:
strReport = "APPROVE/DENY COMBO"
Case 4:
strReport = "APPROVE/DENY OPTION 1"
Case 5:
strReport = "DENIALS"
Case 6:
strReport = "DENIALS WITH OPTION 1"
Case 7:
strReport = "REVIEW CONTINUANCES"
Case 8:
strReport = "TIME AGING"
Case 9:
strReport = "DISABILITY APPLICATIONS"
Case 10:
strReport = "REVIEW DISCONTINUANCES"
Case 11:
strReport = "SIX MONTHS OR OLDER"
Case 12:
strReport = "SPECIALIST MONTHLY REPORTS"
Case 13:
strReport = "WITHDRAWN APPLICATIONS"
Case 14:
strReport = "DECEASED"
End Select

DoCmd.OpenReport strReport, acViewNormal, , "[Specialist]='" & Me!cmbSpecialist & "'"
End Sub
 
Try something like this:

Dim obj As AccessObject, dbs As Object, strReportName As String
Set dbs = Application.CurrentProject
' Search for AccessObject objects in AllReports collection.
For Each obj In dbs.AllReports
strReportName = obj.Name
DoCmd.OpenReport strReportName, acViewNormal
Next obj
 

Users who are viewing this thread

Back
Top Bottom