Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Searchable Combobox with Textbox?

Status
Not open for further replies.

Technos

Programmer
Mar 15, 2002
47
US
Hi All
I have proble searching the combobox.
I want to use a text box to search a combo box. Like as we type in the text box it should search the combo box. Kind of synchro ???
How to do this.
I created the same in VB but don't know how to do it in ASP.
I'm giving you a VB Code.
Please Help....
for ASP its giving error cboname --- object required
Code:
Private Sub txtFind_Change()
    lngCurr = cboName.ListIndex
    For i = 0 To cboName.ListCount - 1
        cboName.ListIndex = i
        If Left(UCase(cboName.Text), Len(txtFind.Text)) = UCase(txtFind.Text) Then Exit For
    Next
 
    If cboName.ListIndex = cboName.ListCount - 1 Then
        For i = cboName.ListIndex To 1 Step -1
            cboName.ListIndex = i
            If Left(UCase(cboName.Text), Len(txtFind.Text)) = UCase(txtFind.Text) Then Exit For
        Next
    End If
    If cboName.ListIndex = 1 Then cboName.ListIndex = lngCurr
End Sub

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top