• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 286
  • Last Modified:

Reports - Print all reports from one command button ?

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
0
syldania
Asked:
syldania
1 Solution
 
DrTechCommented:
sub PrintAll
  dim i as long
 
  for i=1 to 14
    printreport i
  next i

end sub

sub printReport(reportId as long)

   Select Case report Id
       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
0
 
shanesuebsahakarnCommented:
Rather than a case statement, you can also just follow the openreport lines with another one:
DoCmd.OpenReport "APPROVALS"
DoCmd.OpenReport "APPROVED ADDITIONAL CONDITIONS"
DoCmd.OpenReport "APPROVE/DENY COMBO"

...etc...
Or for your filtered version:
DoCmd.OpenReport "APPROVALS", , "[Specialist]='" & Me!cmbSpecialist & "'"
DoCmd.OpenReport "APPROVED ADDITIONAL CONDITIONS", , "[Specialist]='" & Me!cmbSpecialist & "'"
DoCmd.OpenReport "APPROVE/DENY COMBO", , "[Specialist]='" & Me!cmbSpecialist & "'"
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now