Results 1 to 2 of 2

Thread: Help needed with ADO.

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2001
    Posts
    17

    Unhappy

    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

  2. #2
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width