Hi, how do I use ADO to search for a record in my database from a txtbox instead of an Input Box.
What I want to do is search for a record on its ID number and display that record on the same form. How do I do this?
Thanks
Vaastav
Printable View
Hi, how do I use ADO to search for a record in my database from a txtbox instead of an Input Box.
What I want to do is search for a record on its ID number and display that record on the same form. How do I do this?
Thanks
Vaastav
Here ya go: You'll have to do some validation in case the record does not exist:
Code:Private Sub Command1_Click()
Adodc1.Recordset.Find "Invoice_no = '" & Text1.Text & "'", , adSearchForward
If Adodc1.Recordset.EOF Then
Adodc1.Recordset.Find "Invoice_no = '" & Text1.Text & "'", , adSearchBackward
End If
End Sub