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

rs.FindFirst with Multiple Criteria??? 1

Status
Not open for further replies.

VoodooRage

Programmer
Oct 9, 2002
43
US
Can you utilize the "FindFirst" method with multiple arguments for the search criteria?

For example if you want to find a record based on two criteria such as

rs.FindFirst "[CNUM] ='" & Forms!Frm!CNUM & "'" AND "[Item] = '" & Forms!Frm!List73 & "'"

can this be done?

As Always THANKS bunches!

 
Yes. When using things like "FindFirst" or "filters", you're basically building the WHERE clause of an SQL statement. So, write it thus:
Code:
rs.FindFirst "[CNUM] ='" & Forms!Frm!CNUM & "' AND [Item] = '" & Forms!Frm!List73 & "'"


The AND goes inside the quotes, resulting in a string that at run-time looks something like:
Code:
rs.FindFirst "[CNUM] ='somevalue' AND [Item] = 'someotherval'"
--
Find common answers using Google Groups:

 
That was fantastic!

I really appreciate the help. I have been banging my head on this for an hour and a half!

This forum ROCKS!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top