title: Looping through recordset vb6
body: <p>So, I've done this a million different ways but this is bothering me a bit. I'm trying to loop through a recordset, identify a number and compare to the next record. If they match, I want to change matching value. It seems to work, somewhat, but then I get all records as "Matched".... saying that there is 'No matched record'. I'm sure it's something dumb I'm missing so if anyone could point out my flaw here, that would be awesome! As always, thanks in advance!!!</p>
  
  <pre><code>    con.Open _
  "Provider=Microsoft.Jet.OLEDB.4.0;" &amp; _
  "Data Source=" &amp; App.Path &amp; "\Books.mdb;" &amp; _
  "Jet OLEDB:Engine Type=4;"
  
  rs1.Open "A", con, adOpenKeyset, adLockPessimistic, adCmdTableDirect
  rs2.Open "B", con, adOpenKeyset, adLockPessimistic, adCmdTableDirect
  
  rs1.MoveFirst
  While Not rs1.EOF
      rs2.MoveFirst
      While Not rs2.EOF
           If rs1("ID").Value = rs2("ID").Value Then
           With rs2
              !Matching_Criteria = "Matched"
              .Update
              End With
           Else
               With rs2
              !Matching_Criteria = "UnMatched"
              .Update
              End With
           End If
          rs2.MoveNext
      Wend
  rs1.MoveNext
  Wend
  </code></pre>