Problem using .find

kirkm

Registered User.
Local time
Tomorrow, 10:13
Joined
Oct 30, 2008
Messages
1,257
I'm passing a recordset and a string into a Function.

I want to return True if mystring is present in the Name columm in the recordset.

Testing (so far) has

r3.Find "Name = '" & mystring & "'"
Debug.Print r3.NoMatch

It's going to error "Method or data member not found" on r3.Find

afaik "find" is a member so I'm a bit stuck.

Also what I don't know yet, is a loop though every record needed (in which case I can bin 'Find' and just check each value), or will it automatically look at all records?
 
Don't show a snippet but entire code -also the code declaring and opening the record set. Also, "Name" is a reserved word and as field name will get you into deep doodoo sooner or later. Google access reserved words.
 
find is for ADO recordsets. Is that what you're using? if you don't know specify your recordset with
Dim r3 as adodb.recordset
I can't remember which function requires it, but one of the find/seek functions requires the field to be indexed.
DAO is the other method for recordsets and uses .findfirst & .findnext
 
Thanks guys. It was a DAO recordset and now .FindNext is not going to error and working on the whole recordset. Thanks.

I've changed "Name" and will give more detail next time. I was still nutting it out... and stuck on that one line.
 

Users who are viewing this thread

Back
Top Bottom