Solved

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

Posted on 2016-10-26
2
50 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

735 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