Results 1 to 8 of 8
  1. #1
    VictoriaAlbert is offline Novice
    Windows Vista Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    16

    Query results into Report

    I'm new to Access and would greatly appreciate some insight into generating reports. Here's what I want to do.



    I have a table with data fields that include County, Hospital, Social Worker, Patient Case Number, Payer, Referral, Outcome, etc. I want to generate a report that summarizes this table (and not just list those records that meet a certain criteria, which is what all the examples seem to be about). For example, one part of the report would be listing the different Social Worker's names and how many patients they saw. A calculation may be to also include what percentage of all patients this number of patients represents. The next part (ideally on the same page) of the report would then list the different Payer Sources, a count, and a percentage of the total.

    I can generate queries for most of what I want to do, but I cannot seem to figure out an efficient way to get all the data I need on one report. For example, I can generate one query that returns the Social Worker's names and how many patients they saw, then another query (based on that first query) that returns the percentage of the total. I then include both queries in the Record source for the Report. When I try to insert the results of those queries in text boxes in the Report, it just returns the results of the first row of the query.

    Am I totally off on my approach to this problem?

    Any insight would be greatly appreciated.

    --Rachel

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    How would you include two queries in the report RecordSource? A report can have only one data source. Possibly you need to use subreports. Or maybe set up report Grouping & Sorting features with summary calcs in group section header/footer.
    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
    VictoriaAlbert is offline Novice
    Windows Vista Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    16
    I found instructions on how to include multiple queries in a report from here:
    http://office.microsoft.com/en-us/ac...001055099.aspx

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    As I said, a RecordSource can be only one data source. That can be a table or a query that joins tables and/or queries. As that article states, the tables and/or queries must be related. They must be able to be joined. If you have established relationships in the Relationship builder, when you pull tables into query designer the join link will be established. For queries you will probably have to manually set the joins in the query designer.

    Does the RecordSource show a join of the tables/queries?
    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.

  5. #5
    VictoriaAlbert is offline Novice
    Windows Vista Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    16
    No, the queries are not joined. So, it sounds like I need to build the individual queries such that can be joined.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Yes. Or if the data structure does not allow the joining, perhaps report/subreport arrangement will serve your situation.
    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.

  7. #7
    VictoriaAlbert is offline Novice
    Windows Vista Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    16
    I can get the query results to show up in the report - the problem is just that its only the first result (for example, the first output, when there may be 5 for that query). I'm wondering if there's a simple way to make the report show the entire results of the query, not just the first output.

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    If you see the records in the query then they should show in the report. Did you size the Detail section to reduce blank space? However, if the join is not correct I don't see how the data could output properly. Would have to examine project to analyze this.
    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.

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

Similar Threads

  1. Replies: 6
    Last Post: 05-14-2012, 07:24 AM
  2. Sending Results of Querty to Report
    By Xiaoding in forum Programming
    Replies: 16
    Last Post: 06-27-2011, 02:36 PM
  3. Replies: 3
    Last Post: 04-11-2011, 02:13 PM
  4. Strange report results
    By DDows in forum Reports
    Replies: 5
    Last Post: 01-10-2011, 06:43 PM
  5. Replies: 3
    Last Post: 05-21-2010, 03:57 PM

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