Feb 15, 2013 #1 fileman1 Technical User Feb 7, 2013 152 GB Is there a faster method to find a record than this? Code: Do While Not rs3.EOF If rs3!TargetID = PK2 And rs3!ID1 = PK1 Then Do something in here Exit Do End If rs3.MoveNext Loop Starting to take a while to find
Is there a faster method to find a record than this? Code: Do While Not rs3.EOF If rs3!TargetID = PK2 And rs3!ID1 = PK1 Then Do something in here Exit Do End If rs3.MoveNext Loop Starting to take a while to find
Feb 15, 2013 #2 dhookom Programmer Jun 24, 2003 22,552 US How about providing some context and perhaps more code. You haven't provided much to work with. Duane Hook'D on Access MS Access MVP Upvote 0 Downvote
How about providing some context and perhaps more code. You haven't provided much to work with. Duane Hook'D on Access MS Access MVP
Feb 15, 2013 1 #3 PHV MIS Nov 8, 2002 53,708 FR If DAO and PKs are numeric: Code: rs3.FindFirst "TargetID=" & PK2 & " AND ID1=" & PK1 If Not rs3.NoMatch Then Do stuff here End If Hope This Helps, PH. FAQ219-2884 FAQ181-2886 Upvote 0 Downvote
If DAO and PKs are numeric: Code: rs3.FindFirst "TargetID=" & PK2 & " AND ID1=" & PK1 If Not rs3.NoMatch Then Do stuff here End If Hope This Helps, PH. FAQ219-2884 FAQ181-2886
Feb 15, 2013 Thread starter #4 fileman1 Technical User Feb 7, 2013 152 GB I am looping a recordset in vba to find a record in the recordset that meets with 2 conditions being met rs3!TargetID = PK2 And rs3!ID1 = PK1 Upvote 0 Downvote
I am looping a recordset in vba to find a record in the recordset that meets with 2 conditions being met rs3!TargetID = PK2 And rs3!ID1 = PK1
Feb 15, 2013 Thread starter #5 fileman1 Technical User Feb 7, 2013 152 GB Thanks PHV, thats what I wanted. Upvote 0 Downvote