Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2004
    Posts
    58

    Unanswered: Collate and print multiple reports

    I have 4 separate reports each containg 2 A4 pages of data. What I want to be able to do is

    print record 1 of report 1 followed by record 1 of report 2, rec 1 of rpt 3, rec 1 of rpt 4 and

    then go back and print rec 2 of rpt 1, rec 2 of rpt 2, etc.

    I have tried setting them up as subreports but all the data together exceeds the maximum

    available space for the details section of a report.

    Is there another way to do this, ie: VB code linked to a button on a form.

  2. #2
    Join Date
    Nov 2003
    Posts
    267
    Goto Microsofts Knowledgebase and search the Access 2000 for "RptSmp00.mdb" Sample Database

    It has a sample on how to collate two seperate reports, which you should be able to expand into four

    S_

  3. #3
    Join Date
    Feb 2004
    Location
    Indiana, USA
    Posts
    79

    Collate Reports

    Hi,

    I managed without too much difficulty to create the module that I named modCollate as described in ACC2000: Using Visual Basic Code to Collate and Print Two Reports.

    1st Question. This only prints one record from each report. (There should be 1 page (report) for each resident in our building (87) for each report. Do I need to adjust the code?

    2nd Question. How do I trigger the module? (Do I need a macro to trigger the module?) I want to be able to click a button and have it print all the reports that I need collated. Some reports have 1 record for each resident, others only have records for residents based on what programs they are enrolled in.

    Please point me in the right direction.

    Perplexed.




    Option Compare Database

    '***********************************
    'Declarations section of the module
    '***********************************
    Option Explicit
    '************************************************* ********************
    'NumPages is the number of pages in the largest report. If one report
    'has fewer pages, the DoCmd.PrintOut statement for the smaller report
    'runs correctly, and no additional pages are printed.
    '************************************************* ********************
    Function CollateReports(NumPages, Rpt1 As String, Rpt2 As String)
    Dim MyPageNum As Integer

    'Set the page number loop and alternate printing the report pages.
    For MyPageNum = 1 To NumPages
    'NumPages is the number of pages to print.
    DoCmd.SelectObject acReport, "rptADLGrid 1-15", True
    DoCmd.PrintOut acPages, MyPageNum, MyPageNum
    DoCmd.SelectObject acReport, "rptADLGrid 16-31", True
    DoCmd.PrintOut acPages, MyPageNum, MyPageNum
    Next MyPageNum
    End Function

  4. #4
    Join Date
    Feb 2004
    Location
    Indiana, USA
    Posts
    79
    On further review, I think that I will somehow have to tell it to collate reports based on Resident's Record ID.

    When printing individual records from my main form I use
    DoCmd.OpenReport stDocName, acNormal, , "[RecordID]=" & Me!RecordID to tell it which record to print.

    Can this be modified for the collate process?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •