Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2016-10-26
2
Medium Priority
?
72 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 58

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 2000 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 31

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

609 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