On Error GoTo error
Adodc1.Recordset.MoveFirst
Do Until Adodc1.Recordset.EOF
If (Adodc1.Recordset.fields(0) = Text18.Text) Then
Call display
Exit Sub
Else
Adodc1.Recordset.MoveNext
End If
Loop
error: MsgBox "data not found"
Text18.Text = ""
Text18.SetFocus
End Sub
Public Sub display()
Text2.Text = Adodc1.Recordset.fields(1)
Text3.Text = Adodc1.Recordset.fields(2)
End Sub

sear

  • 1.
    On Error GoToerror Adodc1.Recordset.MoveFirst Do Until Adodc1.Recordset.EOF If (Adodc1.Recordset.fields(0) = Text18.Text) Then Call display Exit Sub Else Adodc1.Recordset.MoveNext End If Loop error: MsgBox "data not found" Text18.Text = "" Text18.SetFocus End Sub Public Sub display() Text2.Text = Adodc1.Recordset.fields(1) Text3.Text = Adodc1.Recordset.fields(2) End Sub