Results 1 to 4 of 4
  1. #1
    kloun04 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jun 2014
    Location
    Wisconsin
    Posts
    33

    Report only specific records

    I have a query that pulls in multiple fields where records have the criteria equal to True. What I am trying to do is create a report with the same multiple fields but show only records that are True and group them by either dept or diagnosis. Each department may include multiple diagnoses for a single patient. Because some records can have a field that is True and a field that is False I can't get what I want.



    For example: A patient has the following diagnoses by a department

    Fields
    Department
    : Hospitalist Med 1
    Diagnosis: Dementia (True), Depression (True), Sleep (False)

    (Grouped by Dept) I want to see only those records under Hospitalist Med 1 whose records are True (Dementia) or (Depression)

    AND as a different report

    (Grouped by Diagnosis) I want to see only those records under Depression diagnosed by a specific department (Hospitalist Med 1)

    Thanks.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,963
    Did you try criteria under the Dementia and Depression fields placed on separate rows to invoke the OR operator?

    This is not a normalized data structure. I always find trying to filter on multiple yes/no fields frustrating.

    If you want different results for different reports, and you want to use filtered query object, each report will require its own query object. Alternatives:

    1. Build query directly in the report RecordSource property.

    2. All the reports can be based on same unfiltered query and then apply filter to the report. This can be done with the report Filter and FilterOnLoad properties or by command when the report is opened.
    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
    kloun04 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jun 2014
    Location
    Wisconsin
    Posts
    33
    June 7: I have the criteria for each field placed on a separate row and the query works appropriately.

    1. Build query directly in the report RecordSource property. ---- Functioning query already built
    2. All the reports can be based on same unfiltered query and then apply filter to the report. This can be done with the report Filter and FilterOnLoad properties or by command when the report is opened. --- The filter doesn't work because if I filter one field in the query it doesn't display the data for all the other fields that are True.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,963
    Right, for option 2 filter cannot be applied in query, it must be applied to the report.
    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: 7
    Last Post: 09-01-2013, 01:04 AM
  2. Replies: 1
    Last Post: 04-04-2013, 11:59 AM
  3. Replies: 1
    Last Post: 01-24-2013, 05:50 PM
  4. Specific records in a form
    By ellixer in forum Forms
    Replies: 1
    Last Post: 06-30-2011, 08:56 AM
  5. Query-for specific records?
    By sirnickettynox in forum Queries
    Replies: 6
    Last Post: 03-30-2011, 03:11 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