Results 1 to 5 of 5

Thread: find in records

  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Correct this part of code to find value in field?

    .....

    TEST_INDICE = ""
    TEST_INDICE = Trim(Sess0.SCREEN.GetString(P, 22, 3)) & "-" & Trim(Sess0.SCREEN.GetString(6, 46, 9)) & "-" & Trim(Sess0.SCREEN.GetString(P, 4, 3)) & "-" & Trim(Sess0.SCREEN.GetString(P, 10, 10))
    Debug.Print TEST_INDICE
    RS1.MoveFirst
    RS1.Find "INDICE='" & TEST_INDICE & "'"

    If Not (RS1.EOF = False And RS1.BOF = False) Then
    MsgBox ("NON TROVATA") 'not found
    Else
    MsgBox ("TROVATA") 'found
    End If

    ....

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts
    Generally, you want to use the NoMatch property after you do a Find; that is: If rs1.NoMatch = False then ...
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by MarkLiquorman View Post
    Generally, you want to use the NoMatch property after you do a Find; that is: If rs1.NoMatch = False then ...
    error: member or method not fiund
    in line rs.NoMatch

  4. #4
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts
    Quote Originally Posted by sal21 View Post
    error: member or method not fiund
    in line rs.NoMatch
    I just noticed, you used: RS1.Find "INDICE='" & TEST_INDICE & "'"

    You should have used: RS1.FindFirst "INDICE='" & TEST_INDICE & "'"
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  5. #5
    5 Star Lounger AndrewKKWalker's Avatar
    Join Date
    Apr 2001
    Location
    Cambridge, UK
    Posts
    1,020
    Thanks
    0
    Thanked 3 Times in 3 Posts
    I assume that RS1 is therefore an ADODB Recordset, which is why NoMatch generates an error.

    What exactly is the correction you are after?
    Where does the error occur if there is one?
    Are you saying that it does not detect the data when it is there or when it isn't?

    At what point is RS1 initiated, and do you check it for Data before you try and
    execute RS1.Movefirst

    Also if using ADO then, you ought to be able to just use

    IF RS1.EOF Then
    ..........
    Andrew

Posting Permissions

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