Results 1 to 5 of 5
  1. #1
    jlgray0127 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Oct 2011
    Location
    Central Illinois
    Posts
    185

    Unbound Search Box

    I have a form and set up a search box. The box works perfectly.

    However, I have button control I use to clear any filtering the users perform. When they click the button, the it works and clears all any filtering they did with either the search box or built in Access filtering.

    However, once they click the Clear Filter button, the search box stops working unless you filter with the access controls and then use the text box, or close the form and reopen it.

    Code for the unbound text box and search button:

    Private Sub Command77_Click()
    Me.Filter = "[Component] Like '*" & [Search] & "*'"

    End Sub

    Code for Clear Filter button, I've tried two different methods. The search box does not work after, using either method.

    1.
    Private Sub Command66_Click()


    Me.Filter = ""
    Me.FilterOn = False


    End Sub

    2.
    Private Sub Command66_Click()
    Me.FilterOn = False


    End Sub

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I would expect

    Me.FilterOn = True

    in the ambiguously-named Command77 code (after the existing code). Does that fix it?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    jlgray0127 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Oct 2011
    Location
    Central Illinois
    Posts
    185
    Doing my best Homer Simpson "Dope!"

    Thank you!!!

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    LOL! Happy to help.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,914
    Quote Originally Posted by jlgray0127 View Post
    Doing my best Homer Simpson "Dope!"

    Thank you!!!
    I thought it was Doh!
    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

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

Similar Threads

  1. Replies: 5
    Last Post: 01-07-2019, 01:51 AM
  2. Unbound Combo box search not working
    By CQCDave in forum Macros
    Replies: 6
    Last Post: 10-19-2015, 02:23 PM
  3. Replies: 6
    Last Post: 09-22-2015, 03:30 PM
  4. Replies: 9
    Last Post: 11-06-2014, 01:15 PM
  5. Replies: 2
    Last Post: 04-17-2013, 02:12 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