Consulting

Results 1 to 4 of 4

Thread: Listbox name lookup

  1. #1

    Listbox name lookup

    I have a list box in access 2013 that list from a table. It's a database of names of membership. I would like to sort the list by names. This will be a box that you would type into and it would sort the list by that criteria......

    ie... type smith

    The listbox would then sort the list to all names that start with smith or what ever letters you put in..... ie S would sort all s names etc...

    The listbox is populated by a query.

    Thanks,

    D

  2. #2
    Added information:

    The listbox is from a query named: QryListAll
    the text box is: TextSearch
    the field I'm attempting to filter by is: Full Name (it's in the QryListAll by conc. FirstName & LastName)

    Hope this helps..

    This is what I have so far....

    
    
    
    Me.List5.RowSource = "SELECT Full Name FROM QryListAll " _
          & "WHERE Full Name """ & Me.TextSearch.Text & """ ORDER BY Full Name"
    I know the field name of Full Name is not good, but that is what I have for now... will it help to enclose it in []?

    d

  3. #3
    Any advice?

    d

  4. #4
    VBAX Expert
    Joined
    Oct 2012
    Posts
    726
    Location
    If you mean you want to filter the list just use like and wildcards

    "WHERE [Full Name] like '*" & Me.TextSearch.Text & "*' Order by [Full Name]"

    http://office.microsoft.com/en-gb/ac...005188185.aspx

    You will need an event handler or button to update the list when the user has done typing,
    List5.requery

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •