Solved

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

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

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Familiarize people with the process of utilizing SQL Server views 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 Microsoft Access…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

760 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

21 Experts available now in Live!

Get 1:1 Help Now