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

openrecordset of a parameter query

Status
Not open for further replies.

callipygous

Technical User
Jun 19, 2003
10
GB
Hi there,

Im doing some stuff using Access 2000 and DAO, using access modules and VBA code under forms etc..

I have a parameter query that takes its text parameter from a combo box. I want to loop through the recordset of this query but don't know how to open it.

Before, i've used

Set rst = db.OpenRecordset("param_qry", dbOpenDynaset)

rst = recordset
db = my database etc

in a public Sub

any help would be greatly appreciated.
Callipygous
 
Callipygous

If you are using ACcess 2000, have you added a reference to the DAO object library (tools -> references and tick Microsoft DAO object library) and change your code to read

Dim db As DAO.Database
Dim rs As DAO.Recordset

This should stop Access getting confused with ADO code and your existing code should work fine with no other modifications.

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top