Results 1 to 3 of 3

Filter a filter result

  1. #1
    Viking02 is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2017
    Posts
    1

    Filter a filter result


    This has been a long struggle: I have an Access database with about 4000 records. I have created a Command Button that issues an embedded macro with a simple filter reducing the results to about 1000 records. I have created another Command Button to reduce the same 4000 records by a completely different set of criteria that reduces the results further. The two criteria cannot be combined into a single filter. I would like this to be as simple as clicking one button for the first filter applying the broad criteria, then clicking another button reducing the results further.

    I cannot for the life of me get the one filter to further reduce the results of the first filter. One ALWAYS cancels the other. It seems there is an idiotically simple solution, but I have searched for years for any documentation that addresses this. Please help!!!

  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
    42,592
    Why can't the multiple criteria be in one filter action?

    Can progressively filter using the intrinsic filter options on the ribbon. Emulate with Docmd.RunCommand acCmdFilterBySelection. Have to set focus on record/control with desired parameter. Control must be bound to a field, not a textbox with calculation. Don't know if that will be possible with embedded macro, I only use VBA.
    To provide db: Make copy, remove confidential data, run compact & repair, zip w/Windows Compression if over 500KB (2MB zip allowed), attach to post. Attachment Manager is below the Advanced post editor window, click Go Advanced below the Quick Reply window.
    If any suggestion resolves your issue, please use the Thread Tools dropdown above first post and mark as Solved!

    Debug!Debug!Debug! http://www.cpearson.com/excel/debug.htm

  3. #3
    Micron is online now VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    3,111
    I would agree that if one can filter a record set and subsequently filter it further, it would be logical to assume it can be done in one step - provided you know at the first step what the second filter ought to be. If your process is to filter food records then "green" may not be suitable as a second filter if the first filter (FoodType =) had returned meat, as much as if it had been "vegetable". If that is the case, then the primary set could be filtered to the final desired result by reconstructing the first filter, as in
    WHERE FoodType = "vegetable" AND Color = "green"
    once you have captured the second filter value. If that doesn't describe your process, then you should elaborate on what you've tried, what the process is, and what results you got from your prior attempts. I think we are missing some of the picture here.
    - "doesn't work" is no help.Error #s/text do. State what's happening.
    - Use code tags for code/sql; show where errors occur
    Make all suggested changes in copies of your database or to its objects

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

Similar Threads

  1. Replies: 2
    Last Post: 02-20-2017, 10:28 PM
  2. Replies: 0
    Last Post: 03-18-2016, 08:13 PM
  3. Replies: 9
    Last Post: 02-24-2015, 10:19 AM
  4. Replies: 1
    Last Post: 08-16-2012, 12:51 PM
  5. Replies: 1
    Last Post: 12-20-2011, 02:32 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
  •  
Tech Forums: Microsoft Office Forums