Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FindFirst, InStr() And Two Recordsets?

Status
Not open for further replies.

xweyer

MIS
Sep 7, 2000
140
US
Is it possible to combine FindFirst and the InStr() function to identify partial matches between records in two different DAO recordsets?

I was thinking along the lines of something like...

If InStr(rst("AllNames").Value, rst2("OneName").Value) > 0 Then....

where AllNames is a long string containing multiple names and OneName is a single name.

I've tried a number of different variations of this including ones that first assigned two recordset values to string variables but in every case errors occurred. Maybe because I'm exceeding Findfirst's capabilities?
 
what do you want to do with the findfirst
post your code and error
 
How about just using the LIKE operator in the FindFirst?
Code:
rst.FindFirst "AllNames LIKE '*" & rst2("OneName").Value & "*'"


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top