Results 1 to 3 of 3
  1. #1
    BatmanMR287 is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Jan 2014
    Posts
    69

    Running several indiviual reports


    I have an individual report that runs on each person from a district. On each row of the table is an individual and all data needed to run the report. Everyone from the same district has the same district number. I need to pull up a district and run the report on all people from that district. How do I make the report cycle through each person from that district and print a separate report for each person?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Options:

    1. print one report with page breaks after each person - no code required

    2. print multiple reports with filter criteria - requires VBA code to loop through a recordset of people ID, something like:
    Dim rs As DAO.Recordset
    Set rs = CurrentDb.OpenRecordset("SELECT ID FROM table WHERE District=" & Me.cbxDistrict)
    rs.MoveFirst
    While Not rs.EOF
    DoCmd.OpenReport "reportname", , , "ID=" & rs!ID
    DoCmd.PrintOut
    DoCmd.Close acReport, "reportname", acSaveNo
    rs.MoveNext
    Wend
    rs.Close

    This assumes each person is unique in the table and ID is the unique identifier for each person.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    BatmanMR287 is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Jan 2014
    Posts
    69
    Got that to work perfectly. ID is unique identifier. Thanks June7.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 08-07-2015, 01:34 PM
  2. Running monthly reports
    By sunnyday in forum Reports
    Replies: 1
    Last Post: 12-23-2014, 01:33 AM
  3. Replies: 4
    Last Post: 11-25-2014, 12:14 PM
  4. Reports running slow
    By kwooten in forum Reports
    Replies: 2
    Last Post: 12-02-2011, 03:29 PM
  5. Adding Running Balance from Form to Reports
    By KIDGEO3 in forum Reports
    Replies: 1
    Last Post: 01-18-2006, 08:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums