I have two recordsets and I am trying to loop through the first and find the record in the second with the same invoice number, but it keeps taking me to the first record in the second recordset instead.
PartialCode
Set rst = CurrentDb.OpenRecordset(StrSql)
Set rst1 = CurrentDb.OpenRecordset("AR")
rst.MoveFirst
Do While Not rst.EOF
With rst1
.FindFirst "[rst1!inv_no]= '" & [rst!invno] & "' "
If rst1.NoMatch Then
MsgBox "Record not found"
Exit Sub
End If
MsgBox rst1!client & " " & rst1!inv_no & " " & rst1!inv_date
End With
rst.MoveNext
Loop
rst.Close
rst1.Close
Set rst = Nothing
Set rst1 = Nothing
/Code
I am not sure what I am doing wrong. I have tried several things but nothing works. Any help in leading me in the right direction would be appreciated.