In this code you must type the complete word in the textbox that stored in ur table to shows up in the listview.
any1 can help me with this?? it should be base by letters not word.

Private Sub ListView1_click()
Dim rs As New ADODB.Recordset
Dim selected As String


If ListView1.SelectedItem Is Nothing Then

Else

selected = ListView1.SelectedItem

 rs.Open "select  *FROM books  wHERE title like '" & selected & "'", cnn, adOpenStatic, adLockPessimistic
    If rs.RecordCount <> 0 Then
    Text8 = rs!Title

    End If
    End If



End Sub






 Private Sub Text12_Change()



    Dim rs As New ADODB.Recordset
    Dim Item As ListItems


    rs.Open "select * from books where title like '" & Text12 & "' ", cnn, adOpenStatic, adLockPessimistic

    ListView1.ListItems.Clear

    While Not rs.EOF

    ListView1.ListItems.Add , , rs!Title
    ListView1.ListItems(ListView1.ListItems.Count).ListSubItems.Add , , rs!accesionno
    ListView1.ListItems(ListView1.ListItems.Count).ListSubItems.Add , , rs!quantity
    ListView1.ListItems(ListView1.ListItems.Count).ListSubItems.Add , , rs!dateAcquired
    ListView1.ListItems(ListView1.ListItems.Count).ListSubItems.Add , , rs!Value
    ListView1.ListItems(ListView1.ListItems.Count).ListSubItems.Add , , rs!conditions
    ListView1.ListItems(ListView1.ListItems.Count).ListSubItems.Add , , rs!code
    ListView1.ListItems(ListView1.ListItems.Count).ListSubItems.Add , , rs!author


    rs.MoveNext
    Wend





    End Sub

Hi,

You have to use "%" around the text like this....

rs.Open "select * from books where title like '%" & Text12 & "%' ", cnn, adOpenStatic, adLockPessimistic

Regards
Veena

thanks worked ^^

commented: Please mark as solved, thanx +12

Now, please mark as solved, thanx :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.