Results 1 to 5 of 5
  1. #1
    Yodo is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Apr 2017
    Posts
    12

    How to apply several filters to the form?

    I have a split form. To filter a datasheet table I use filter on my combo box after update event :


    Code:
    Me.Filter = "[WhateverFieldNameTheComboIsFiltering] = " & Chr(34) & Me.ComboNameHere & Chr(34)
    Me.FilterOn = True

    It works fine but when I want to apply another two filters ( another comboboxes), they work sort of against each other, I mean they are not filtering what first filter has selected and it results in a total mess because in datasheet I see names which not assigned to the seleced id.

  2. #2
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228
    Can you not use query criteria referencing the combo boxes? (forms query)

    the update would only need to requery then.. or refresh. (I put in both as I forget which it is.)

  3. #3
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051

    How to apply several filters to the form?

    Or you could create a myfilter line from each of the comboboxes to be run when a command button is pressed.

  4. #4
    Yodo is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Apr 2017
    Posts
    12
    Thank you for the answers! But what is a "myfilter line?" And I need to create a special button to filter that?

  5. #5
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    Easier to extend your original filter using " and " & whatever field = cbo2.value & " and "

    And so on.

    Advice. Use a string myfilter rather than me.filter directly.

    It could get tricky and you'll be able to debug that string easier.

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

Similar Threads

  1. Apply multiple filters to subform
    By Elwood07 in forum Forms
    Replies: 10
    Last Post: 07-06-2015, 12:17 AM
  2. Replies: 7
    Last Post: 11-01-2013, 09:14 AM
  3. Replies: 2
    Last Post: 02-25-2013, 10:47 AM
  4. Apply Multiple filters
    By spitfire122 in forum Access
    Replies: 2
    Last Post: 07-01-2011, 10:02 AM
  5. Form Filters Help
    By JeffG3209 in forum Forms
    Replies: 1
    Last Post: 05-22-2011, 10:31 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