Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2010
    Posts
    7

    Question Unanswered: Combobox - Auto Filters When User Types Criteria

    Hi,

    I have searched the forum but couldnt find what I was looking for.

    I have a combobox (populated from a query) on a form which has several hundred product descriptions. When the user starts typing any part of a product description I want the combobox to filter out products that dont contain what the user has entered, they could then click on the product they want.

    If you can point me in the right direction I'd really appreciate it.

    Thanks in advance.

  2. #2
    Join Date
    Jul 2004
    Location
    South Dakota
    Posts
    267
    Have you played around with the LimitToList and AutoExpand properties? I think AutoExpand is what you are looking for. Just set it to Yes and it will filter the list based on what is being typed in.

    C

  3. #3
    Join Date
    Mar 2010
    Posts
    7
    Thanks for the update.

    I found the following site with exactly what I wanted. All you need to do amend the code from this site:

    How Do I Set Up Find As You Type In A Combo Box? - Microsoft: Access Forms FAQ - Tek-Tips

    Thanks

  4. #4
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    IF this is where you want it to search after each character is typed (versus using the typical combobox default where it auto-fills as you type), this method is rarely recommended due to the toll it takes on the form/table with large recordsets. If for example, you're doing this on a 100,000+ recordset, you'll find it to work somewhat slow, especially since the benefits don't really out-weigh the cons (ie. the user types into the combobox and it auto-fills as they type versus having it requery the records after each character is entered, sometimes pausing for 2-3 seconds after each character.) If you throw in other factors such as a slow network for example, you'll find users screaming to have it changed (I've been there, done this, and would only recommend this method for small recordsets.) Again though, this is where you use the OnChange event so it queries after each character versus letting the combobox do it's normal thing (which doesn't require any coding.)

    I personally prefer the alphabetical search example in the code bank.
    Last edited by pkstormy; 04-27-10 at 21:08.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

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