?
Solved

Reports - Print all reports from one command button  ?

Posted on 2003-03-19
2
Medium Priority
?
279 Views
Last Modified: 2008-02-26
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
Comment
Question by:syldania
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 6

Accepted Solution

by:
DrTech earned 375 total points
ID: 8165677
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
 
LVL 41

Expert Comment

by:shanesuebsahakarn
ID: 8166163
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Suggested Courses

762 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