Incremental Search Using Combo Box in VB 4.0 (32-bit)

Posted on 1997-04-23
Last Modified: 2008-02-26
How do I implement a incremental search thru entering
text in the combo box in VB 4.0 (Something similar to
MS Access Combobox feature) ?  I have problem setting
the text of the combo box to the selected listitem's text
when the drop-down list of the combo box is visible.
I am not using Data Control , hence DBCombo is not a
Please help!  
Question by:cccnem
  • 3
  • 2

Accepted Solution

milton042297 earned 100 total points
ID: 1425639
Use the "DBCombo Control", you can get the definitions on VB Help.

Author Comment

ID: 1425640
Edited text of question

Author Comment

ID: 1425641
I am not using Data Control in this instance, so DBCombo cannot solve the problem. Any other alternative?

Author Comment

ID: 1425642
I am not using Data Control in this instance, so DBCombo cannot solve the problem. Any other alternative?

Expert Comment

ID: 1425643
At the begginig of the code put some thing like this...

Set SnapProcura = DB.CreateSnapshot("select DISTINCT[Titulo] from TAB_Procura ORDER BY Titulo")
    If SnapProcura.RecordCount > 0 Then
        While Not SnapProcura.EOF
            CmbPalavra.AddItem SnapProcura("Titulo")
    End If
This code load the combo.

At the "Change" Event of the combo put something like this code...
Do While i < CmbPalavra.ListCount
     Expressao = Left$(CmbPalavra.List(i), Len(CmbPalavra.Text))
     If UCase$(CmbPalavra.Text) <= UCase$(Expressao) Then
            LstPalavra.TopIndex = i
            'LstPalavra.ListIndex = i
            i = 0
            Exit Do
      End If
      i = i + 1

This code make the search of the combo box.

good luck

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

Suggested Solutions

Introduction While answering a recent question ( in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

911 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

17 Experts available now in Live!

Get 1:1 Help Now