using find on ado

  • Thread starter Thread starter Roy Goldhammer
  • Start date Start date
R

Roy Goldhammer

Hello there

I'm trying to use find of ado with two conditions

I tried this:
rst.Find("Field1='text' AND Field2=56)

it beings me en error: 3001 arguments are of wrong type, are out of
acceptable range...

where is the problem here?
 
i'm not up to speed on ADO's Find functionality, but i can tell you that you
have an unclosed double quote

rst.Find("Field1='text' AND Field2=56)

close the double quote, as

rst.Find("Field1='text' AND Field2=56")

hth
 
I'm pretty sure you can only use one field in your criteria. I have no idea
why they designed it this way - makes no sense to me. So you'd have to use a
loop, starting at the beginniing of the recordset. In the loop do a find on
the first field. If you get a match, check the value of the 2nd field. IF not
a match, find the next occurrence of that first field (ADO doesn't have
FIndFirst, FIndNext, they have optional parameters you have to use with FInd
to do that).

Jim B
 
Roy Goldhammer said:
Hello there

I'm trying to use find of ado with two conditions

I tried this:
rst.Find("Field1='text' AND Field2=56)

it beings me en error: 3001 arguments are of wrong type, are out of
acceptable range...

where is the problem here?

The ADO .Find method allows only one column find.

For alternatives, try the .Filter property , or for instance (re)open
the recordset with a where clause.

rst.filter = "Field1='text' AND Field2=56"
 
Back
Top