Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 1997-04-23
5
Medium Priority
?
440 Views
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
solution.
Please help!  
0
Comment
Question by:cccnem
[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
  • 3
  • 2
5 Comments
 
LVL 1

Accepted Solution

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

Author Comment

by:cccnem
ID: 1425640
Edited text of question
0
 

Author Comment

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

Author Comment

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

Expert Comment

by:milton042297
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")
            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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

670 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