From the code window, choose References on the Tools menu.
Check the box beside:
Microsoft DAO 3.6 Library.
You must be using Access 2000 or 2002. All other versions have a reference
to this library automatically.
More on references:
http://allenbrowne.com/ser-38.html
BTW, I presume you want to actually do something with the recordset when you
have it open? It does not display, but is useful for finding things out
programmatically. When your procedure is finished, you need to close it and
set the object to Nothing, i.e.:
rs.Close
Set rs = Nothing
If you just wanted to lookup a single value, you could use DLookup()
instead. More info:
Getting a value from a table: DLookup()
at:
http://allenbrowne.com/casu-07.html