using find on ado

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?
 
T

tina

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
 
J

Jim Burke in Novi

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
 
R

RoyVidar

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"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top