Results 1 to 6 of 6
  1. #1
    database_1 is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Mar 2020
    Posts
    34

    Easy way to clear subform sorting filters

    So I have a search form for the database I made. The search form has a subform table which shows the values searched. I realized the subform table had it's own filters and sorting on the top of each header the user can use. I was wondering if there was a way to code a button so when it is pressed, it resets the fitlers and sortings on the subform table that the user put? Thank you for your time.

    -Thomas Ward

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,409
    the click event for a button to clear the filters would have code something like

    me.filter=""
    me.filteron=true
    me.orderby=""
    me.orderbyon=true

    if the button is on a main form and you want to clear a subform then replace me with subformname.form

  3. #3
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,778
    Isn't it enough to simply write Me.FilterOn = False? Can't say I've ever tried, but it seems that it should be sufficient.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,409
    that just stops the filter - the filter string is still populated

  5. #5
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,778
    Sure, the property has a value, which you'd over-write the next time you want to set it in code. However the filter is turned off, which I thought was enough to remove the form filter. I'm just going by M$:
    You can remove a filter by choosing the pressed-in Apply Filter button, choosing Remove Filter/Sort on the Records menu, or using Visual Basic to set the FilterOn property to False.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  6. #6
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,409
    guess you can - it's just the way I've always done it

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

Similar Threads

  1. Replies: 22
    Last Post: 04-21-2017, 08:23 AM
  2. Apply multiple filters to subform
    By Elwood07 in forum Forms
    Replies: 10
    Last Post: 07-06-2015, 12:17 AM
  3. Clear Filters and Checks on Load--Form
    By nick404 in forum Forms
    Replies: 11
    Last Post: 06-09-2015, 10:46 AM
  4. Disable Ability to Clear Filters
    By mbake085 in forum Programming
    Replies: 1
    Last Post: 06-22-2011, 09:06 AM
  5. Subform with multi filters
    By Aragon.2009 in forum Forms
    Replies: 0
    Last Post: 08-27-2010, 03:01 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