Results 1 to 3 of 3
  1. #1
    Robyn_P's Avatar
    Robyn_P is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Nov 2017
    Posts
    150

    Combobox filter using hidden text box and LIKE in SQL not working

    Hey,

    I'm at my wits end.

    I have a method that I use to filter combo boxes and list boxes that works on all of my forms except one, where the filter has no effect and I can't for the life of my work out why. My only thoughts are that this combo box is based off a query and I'm trying to filter on the bound column rather than being based on a table, but I can't see why that should matter.

    Here's the position.I have a form.

    My form has a combobox called cboMateGroups
    It has a filter box, txtFilter. Where people type in text which is meant to filter the list of entries that show up in cboMateGroups
    It has a hidden text box called txtHidden.

    The OnChange event of txtFilter contains the following code.
    me.txtHidden = me.txtFilter.text
    me.cboMateGroups.requery

    The data in cboMateGroups is as follows it's based on a query, I don't know if that matters.



    Column 1: MateGroup, Sort ascending, criteria LIKE "*" & [Forms]![frmReviewMates]![txtHidden] & "*"
    Column 2: Status

    Column 1 is the bound column

    I'm really not sure what else to write. I can type anything into txtFilter and the combo box isn't filtered, no errors, just no filter. I use Exactly (well clearly not exactly) the same method on at least 6 other forms and it works perfectly.

    (P.S. I really like this method for filtering long lists/combo boxes)

    Any ideas, anything would be really appreciated. It's not crucial but I don't like not understanding and I have no idea. If anything isn't clear just let me know.
    Last edited by Robyn_P; 03-09-2018 at 08:15 AM. Reason: Spaces missing

  2. #2
    Robyn_P's Avatar
    Robyn_P is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Nov 2017
    Posts
    150
    Don't worry. I'm a moron. Had some other vba come that was setting the row source. I've found that if you program the row source that takes precidence.

    Have removed that code, it's and I know better methods now, and everything is working fine.

    Thanks.

    PPS. It really is a nice easy filter as you type method. I also change spaces to asterisks in the onkeypress event.

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    Thanks for updating the thread! I'll mark it solved.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Combobox blank when bound column hidden
    By dippim in forum Forms
    Replies: 2
    Last Post: 11-25-2014, 11:18 AM
  2. Combobox subform filter: text field vs. number field
    By Alhassani in forum Programming
    Replies: 2
    Last Post: 07-08-2014, 10:04 AM
  3. Replies: 5
    Last Post: 03-21-2013, 04:37 PM
  4. Replies: 1
    Last Post: 09-06-2011, 01:47 PM
  5. Replies: 0
    Last Post: 08-24-2010, 06:38 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