Solved

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

Posted on 2016-10-26
2
33 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

867 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now