Results 1 to 10 of 10
  1. #1
    Forbes's Avatar
    Forbes is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Mar 2017
    Posts
    133

    Filter Report Data

    I am struggling with a report I am working on.. well three technically. I have 3 departments where I work, all of them log employee errors monthly and at the end of the month we ship those reports. My report is fairly simple, it has the "error name" then the "amount of times it happened"(count) and the list of employees that were marked for that error using concatrelated().



    All of the reports go to one database and a query filters the text boxes on the report to divide the departments all fields work accept the concatrelated, it does what it's supposed to and shows all the employees that received that error but it shows them from all departments. As of now the departments are separated because I told the query that so and so's name is in this department, however the concat related is not part of the query it is built into the text box... is there a way to specify within my concatrelated(), to show only employees conditioned by that department.

    =ConcatRelated("[condname]","reports","[cond] = '" & [cond] & "'") is my statement so it pulls all of the employees hit for that condition

    condname=employee conditioned
    cond= error name

    is there a way to maybe simply add a Where clause and type in the names of the employees one at a time? I don't mind annoying work to make this work.

  2. #2
    Forbes's Avatar
    Forbes is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Mar 2017
    Posts
    133
    I tried this =ConcatRelated("[condname]","reports","[cond] = '" & [cond] & "'" And ((([Reports].[condemp])="Bob" Or ([Reports].[condemp])="Chris" Or ([Reports].[condemp])="Jessica")))

    but I get the NAME#? error

  3. #3
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,471
    Can you give sample of your data before and what you want it to look like after?


    =ConcatRelated("[condname]","reports","[cond] = '" & [cond] & "'" And ((([Reports].[condemp])="Bob" Or ([Reports].[condemp])="Chris" Or ([Reports].[condemp])="Jessica")))

    Not sure if it will still work but I think you need to take out that one quote before the AND so should be & "' And

  4. #4
    Forbes's Avatar
    Forbes is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Mar 2017
    Posts
    133
    Removing the " didn't work unfortunately I am going to change some of the data in my project for privacy issues and upload the db

  5. #5
    Forbes's Avatar
    Forbes is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Mar 2017
    Posts
    133
    Attachment 27852

    you can see that the garbagereport and the admin report have conditions for the same thing however the conditioned employees part shows employees from both reports if you open the reports in design view you can see my concat function

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    How about:

    =ConcatRelated("[condname]","reports","[cond] = '" & [cond] & "' And ([condemp]='Bob' Or [condemp]='Chris' Or [condemp]='Jessica')")
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    Forbes's Avatar
    Forbes is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Mar 2017
    Posts
    133
    This seems to be working but I have encountered another issue in the same database now the Count function shows every ones numbers

  8. #8
    Forbes's Avatar
    Forbes is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Mar 2017
    Posts
    133
    Disregaurd that last post that was my fault for putting another Or where and and should be Thanks Paul your a genius

  9. #9
    Forbes's Avatar
    Forbes is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Mar 2017
    Posts
    133
    Never mind thanks again! haha

  10. #10
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 1
    Last Post: 03-22-2015, 02:21 PM
  2. Replies: 3
    Last Post: 10-30-2014, 06:24 AM
  3. Replies: 4
    Last Post: 04-30-2014, 09:40 PM
  4. Replies: 2
    Last Post: 05-10-2013, 03:37 PM
  5. Replies: 4
    Last Post: 07-14-2011, 09:49 AM

Tags for this Thread

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