Creating a Search Field
Posted on 2011-02-24
I am creating a search field to find records in my database using an unbound text called txtSearch, a command button called cmdSearch, and a the field cboSIMNO as the search field. Pleas see below.
Private Sub cmdSearch_Click()
Dim strSIMNo As String
Dim strSearch As String
If IsNull(Me![txtSearch]) Or (Me![txtSearch]) = "" Then
MsgBox "Please enter a value!", vbOKOnly, "Invalid Search!"
strSIMNo = Me.cboSIMPhoneNo.Text
strSearch = Me.txtSearch.Text
I know that i have records in my database with the same details but it will only show the first record. How do i get it to show the other records? I need to use a loop somewhere or find next record but i am not sure how to add it into my code.