Hi, i dont think it's wise to ask someone to download your file and try to solve your problem. I think it's better to post your code so others can analize and try to give you solution, and since i dont know exactly what is your problem, then maybe i can only give my solution from my point of view.

IMHO you could do a double click on cmdSearch and enter your search code.

Hi you can use my code:


If Me.cboSearchBy.Text <> "" Then

Set rs = New ADODB.Recordset
rs.Open "SELECT * FROM tblStudentProfile WHERE  " & Me.cboSearchBy.Text & "  LIKE '%" & Me.txtSearchField.Text & "%'", db, 3, 3

If Not rs.EOF Then
Do Until rs.EOF
        With rs
            ListView1.ListItems.Add , , rs!StudentID
            ListView1.ListItems(ListView1.ListItems.Count).SubItems(1) = rs!StudentLastName + ", " + rs!StudentFirstName + " " + rs!StudentMI
            ListView1.ListItems(ListView1.ListItems.Count).SubItems(2) = rs!Age
            ListView1.ListItems(ListView1.ListItems.Count).SubItems(3) = rs!Birthdate
            ListView1.ListItems(ListView1.ListItems.Count).SubItems(4) = rs!HomeAddress
            ListView1.ListItems(ListView1.ListItems.Count).SubItems(5) = rs!ContactNo
            ListView1.ListItems(ListView1.ListItems.Count).SubItems(6) = rs!HSYear
            ListView1.ListItems(ListView1.ListItems.Count).SubItems(7) = rs!HSSection
        End With
End If
rs.Close: Set rs = Nothing

lblTotal.Caption = ListView1.ListItems.Count
MsgBox "Please specify something to search by", vbInformation, "Unable to search"

End If
This article has been dead for over six months. Start a new discussion instead.