Results 1 to 2 of 2
  1. #1
    smpk42 is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2016
    Posts
    1

    Search List results as data is typed

    I have seen many web-based applications where the user begins typing a search value and a selection combo box appears below it with pertinent results.
    The user can then select the desired record from the limited list based on the text entered.



    Can that be done using VBA code in MS-Access?

    Example - I enter a text box and start typing - I enter the value "THE" and immediately listbox/combobox appears with all of the possible database records beginning with "THE"

  2. #2
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    As long as it has a row source, the default behaviour of a combobox is autocomplete, which is what you're asking for in one part of your post. However, you are also intermingling 'listbox' and 'textbox' in your post, and they do not possess this feature by default. Since a textbox cannot hold a list, I won't address that one further. To create this for a listbox would require you to requery the listbox upon each character being typed into a textbox. The event for the textbox would be On_Change and the call could be as simple as Me.MyListbox.Requery. The underlying query for the listbox would have to use the LIKE operator for the field you're going to search on because most of the time there would not be an exact match.

    Here's a link that describes one way to accomplish it, but it's more centered around a continuous form or datasheet. http://allenbrowne.com/AppFindAsUType.html
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 9
    Last Post: 11-06-2014, 01:15 PM
  2. Replies: 2
    Last Post: 11-05-2014, 09:16 AM
  3. Replies: 3
    Last Post: 12-09-2013, 08:53 AM
  4. Replies: 3
    Last Post: 09-02-2013, 04:33 PM
  5. Search - If no results
    By adams.bria in forum Programming
    Replies: 5
    Last Post: 04-03-2012, 09:59 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