Link to home
Start Free TrialLog in
Avatar of syldania
syldania

asked on

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
ASKER CERTIFIED SOLUTION
Avatar of DrTech
DrTech

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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 & "'"