How to Filter Data using a Search Box?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mesairv
    New Member
    • Nov 2011
    • 3

    How to Filter Data using a Search Box?

    Hi everyone.

    Im new here. I had been reading several topics in line with filtering, but i cannot find one related to my concern.

    Please help me to create a command button that will filter my form using a Search Box.

    I mean, the value that will be inputted in the Search Box will be used as the criteria to filter the form that i am dealing.

    Thank you..
  • Seth Schrock
    Recognized Expert Specialist
    • Dec 2010
    • 2965

    #2
    Is the Search Box on the same form that you want filtered or does the button open another form based on the Search Box?

    Overall, the general principle is to create a query with the fields that you want shown in the form and the query has a criteria pointing to the search box. This is extremely simple if you are opening another form, but definitely doable either way.

    Comment

    • mesairv
      New Member
      • Nov 2011
      • 3

      #3
      The search box is on the same form...

      Comment

      • Seth Schrock
        Recognized Expert Specialist
        • Dec 2010
        • 2965

        #4
        You need to make your current form based on a query and then turn it into a subform and put the Seach box on the main form. The the query will have the Search Box as the criteria for the field that you are searching. Then all you have to do is in the After Update event of the Search box, add the following code:
        Code:
        Me.{Your subform name here}.Requery

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32662

          #5
          Try out some of what you find in Example Filtering on a Form.

          Comment

          Working...