Solved

How fill a combobox when any part of a possible selection is being typed

Posted on 2016-10-26
2
40 Views
Last Modified: 2016-10-27
I have a combobox on a form and the AutoExpand = Yes works fine.  But what I would like it for the combobox to "find" a selection based on what I'm typing.  For example, if one of the choices possible is "United Stated Football", and if I start typing "Foot" it will find that record and allow me to use it.

Possible?
0
Comment
Question by:SteveL13
2 Comments
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 total points
ID: 41860307
Not with a combo.   With a text control sync'd to a subform, yes.

However, depending on the set size that your looking through, performance as you type character by character may be quite poor.

You be far better off to let the user type a search term(s) in full, then hand them back a result.

Jim.
0
 
LVL 30

Expert Comment

by:hnasr
ID: 41861098
See if this helps you proceed.
Combo99 rowsource is a select statement for Field:fld from Table:tbl.
Private Sub Combo99_Change()
    Dim ct As String
    ct = Combo99.Text
    Combo99.RowSource = "Select fld from tbl where adesc like ""*" & ct & "*"""
    Combo99.Undo
    Combo99.Requery
    If IsNull(Combo99.ItemData(1)) Then
        Combo99.value = "Not exist"
    Else
        Combo99.value = Combo99.ItemData(1)
    End If
End Sub

Open in new window

0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question