Results 1 to 4 of 4

Thread: How to find a record using DataRow? (RESOLVED)

  1. #1

    Thread Starter
    Addicted Member AlvaroF1's Avatar
    Join Date
    Sep 2002
    Location
    SP - Brazil
    Posts
    200

    Question How to find a record using DataRow? (RESOLVED)

    VB Code:
    1. 'myRS is a DAO recordset
    2. myRS.FindFirst "FIRSTNAME='" & Text1.Text & "' AND LASTNAME='" & Text2.Text & "'"
    How to write a code using a DataRow to find a record with the criteria above?


    Thanks.
    Last edited by AlvaroF1; Aug 12th, 2003 at 03:06 PM.

  2. #2
    Addicted Member
    Join Date
    Aug 2002
    Location
    top of the mountain
    Posts
    234
    Here we go:

    'myRs is datatable
    Dim objCurr() As DataRow
    objCurr =myRs.select("FIRSTNAME='" & Text1.Text & "'
    AND LASTNAME='" & Text2.Text & "'")

    Dim c As DataRow
    For Each c In objCurr
    msgbox(c.item("FIRSTNAME").tostring & " " & _
    c.item("LASTNAME").tostring)
    Next

    I hope that helps.

    regard j

  3. #3

    Thread Starter
    Addicted Member AlvaroF1's Avatar
    Join Date
    Sep 2002
    Location
    SP - Brazil
    Posts
    200
    That helped. Thanx!

  4. #4
    Addicted Member
    Join Date
    Aug 2002
    Location
    top of the mountain
    Posts
    234
    No problemo.

    regard j

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