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!

Multiple criteria for recordset bookmark

Status
Not open for further replies.

emuti

MIS
Apr 18, 2001
37
US
I want my form to look up a record, using the recordsetclone, based on multiple criteria. I know I can do the followign with one criteria:

Set rst = frm.recordsetclone
rst.find "item = " & itemfound
frm.bookmark = rst.bookmark

WHat about multiple criteria in the rst.find line? I keep gettign an error message that Access can't find the object.

Thanks in advance.


 
rst.find "item = " & itemfound & " And Item2 = " & SecondItem

I prefer SQL to find stuff in the database
I is so much more powerful

here some starting point code:

Dim db as database, rst as recordset, SQL as string
Set db = CurrentDb
' SQL string.
SQL = "SELECT * FROM Orders WHERE OrderDate >= #1-1-95# And Price > 50.00;”
Set rst = db.OpenRecordset(SQL)
YourValue = rst!OrderNumber
rst.close
db.close

So you use the "And" statement to have as many of "BOTH" criteria meet
use "OR" if you want "Either this OR that"

DougP, MCP

Visit my WEB site to see how Bar-codes can help you be more productive
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top