Results 1 to 8 of 8
  1. #1
    jhergert is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2024
    Posts
    21

    Better Search/Filtering Method

    Hello Everyone,



    I am in need of some advise/help with a better search and filtering method. Right now the code that i use for searching works great, but it doesn't play well with other methods on a form. I think the term is cascading, I think that is what i am missing/lacking.

    Right now, i have a combo box that i use in the form header that when you select a certian text it will filter the form from say 800 items to 300. But then when i use the search text box it is like it clears out what the combo box did and searches the entire form of 800 items.

    What would be the best way to get these to play nice together?

    Then second item, what is the best way to do a search as you type with keywords

    Thank you in advance,
    Josh

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,979
    Yes cascading, sounds like what you need.
    Plenty of data on those.
    Might want to start with a quick Google https://www.google.com/search?q=acce...hrome&ie=UTF-8

    otherwise you need to adjust your code to check the other fields where your search value might exist using OR
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    CarlettoFed is offline Competent Performer
    Windows 7 64bit Access 2013 32bit
    Join Date
    Dec 2019
    Posts
    258
    Maybe if you show what you've done you can give you some useful advice.

  4. #4
    jhergert is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2024
    Posts
    21
    If you go over to Project Estimating in the navigation bar, and go to frmStructureLookup3. This would be the best one to show the dilemma, where the search/filter features work against each other when using them.

    Thank you for being willing to look at it
    Attached Files Attached Files

  5. #5
    CarlettoFed is offline Competent Performer
    Windows 7 64bit Access 2013 32bit
    Join Date
    Dec 2019
    Posts
    258
    I would say that there are tons of shortcomings in the construction of this program, so you will need to do some serious reading on how to handle Access first.

  6. #6
    davegri's Avatar
    davegri is online now Excess Access
    Windows 11 Access 2019
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,417
    Do away with the filter. Just alter the form's recordsource with the combobox value:

    Code:
    Private Sub Combo113_AfterUpdate()
        Me.RecordSource = "Select * from CombinedStandardsT Where ConstructionType = '" & Combo113 & "'"
    '    Me.Combo113.SetFocus
    '    Me.FilterOn = False
    '    Me.Filter = "[SearchStructure] Like '*" & Combo113 & "*'"
    '    Me.FilterOn = True
    '    Me.Requery
    End Sub
    Then the Clear button code would be:

    Code:
    Private Sub Command41_Click()
        Me.RecordSource = "Select * from CombinedStandardsT"
        'DoCmd.ShowAllRecords
        'Me.Find21.SetFocus
        Me.Find21 = ""
        Me.Check105 = ""
        Me.Check107 = ""
        Me.Check111 = ""
        Me.Combo113 = ""
    End Sub

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,944
    Review this tutorial on a search form http://allenbrowne.com/ser-62.html

    And this version of Find As You Type functionality http://allenbrowne.com/AppFindAsUType.html
    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.

  8. #8
    jhergert is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2024
    Posts
    21
    Or, you could mention what those short comings are so I know what I have to learn more on. Instead of saying learn how to walk again.

    But thank you for your feedback

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

Similar Threads

  1. Filtering Search Form
    By raychow22 in forum Forms
    Replies: 11
    Last Post: 08-17-2017, 12:36 PM
  2. Replies: 12
    Last Post: 06-06-2017, 11:02 AM
  3. Method for updating table from a search form.
    By JulieAHop in forum Forms
    Replies: 6
    Last Post: 02-05-2017, 02:37 AM
  4. Advanced Search / Query Method
    By rabryant1 in forum Queries
    Replies: 10
    Last Post: 06-15-2013, 07:47 PM
  5. Using a combo box as search method
    By jbethann in forum Programming
    Replies: 3
    Last Post: 10-20-2011, 09:21 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