Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 442
  • Last Modified:

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

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
solution.
Please help!  
0
cccnem
Asked:
cccnem
  • 3
  • 2
1 Solution
 
milton042297Commented:
Use the "DBCombo Control", you can get the definitions on VB Help.
0
 
cccnemAuthor Commented:
Edited text of question
0
 
cccnemAuthor Commented:
I am not using Data Control in this instance, so DBCombo cannot solve the problem. Any other alternative?
0
 
cccnemAuthor Commented:
I am not using Data Control in this instance, so DBCombo cannot solve the problem. Any other alternative?
0
 
milton042297Commented:
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")
            SnapProcura.MoveNext
        Wend
    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
Loop

*****************************************************************
This code make the search of the combo box.

good luck
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now