can you help me on this code..

Private Sub cmdRead_Click()
Dim target As String
lstName.Clear
target = txtIdTag.Text
If target = "" Then
MsgBox "You must enter a tag number"
txtIdTag.SetFocus
Exit Sub
End If
target = "id tag=" & target
datStudent.Recordset.FindFirst target
If datStudent.Recordset.NoMatch = True Then
MsgBox "No records found"
txtIdTag.Text = ""
txtIdTag.SetFocus
Else
Do Until datStudent.Recordset.NoMatch = True
lstName.AddItem datStudent.Recordset("name")
datStudent.Recordset.FindNext target
Loop
End If
End Sub


i don't know what wrong with this code.when i run this code,i'm still getting error..

I revised a little bit your code...
What line does the error appear? sorry got no vb6 on my machine :(

Private Sub cmdRead_Click()
      Dim target As String

      lstName.Clear

     If txtIdTag.Text = vbNullString Then
             MsgBox "You must enter a tag number", VbInformation
             txtIdTag.SetFocus
             Exit Sub
      End If

      datStudent.Recordset.FindFirst  "id tag=" & txtIdTag.Text

      If datStudent.Recordset.NoMatch Then
            MsgBox "No records found"
            txtIdTag.Text = ""
            txtIdTag.SetFocus
     Else
           Do Until datStudent.Recordset.NoMatch
                  lstName.AddItem datStudent.Recordset("name")
                  datStudent.Recordset.FindNext "id tag=" & txtIdTag.Text
           Loop
      End If
End Sub
This question has already been answered. Start a new discussion instead.