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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A recordset find with multiple criteria.

Status
Not open for further replies.

qwert231

Programmer
Sep 4, 2001
756
US
I want to do a find with something like this:
"OrderID LIKE '" & orderID & "' AND SubjectID LIKE '" & recSet("SubjectID") & "'"

That line of code following my recSet.Find gives me an error:
ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

This error usually means I haven't set the Const for the adBatchOpenOptomistic or whatever, but I have, and this command works in other code... just not with multiple criteria. Any ideas?
 
Whenever I use a recordset field, I usually say rsTest.fields("field_name") instead of rsTest("field_name"). See if this helps.
 
That's extra code, the default value is .Fields, so you can save yourself a lot of time doing it like I do. And that doesn't matter on a .Find.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top