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

Dim dbs As Database

Status
Not open for further replies.

andzejek

MIS
Sep 1, 2007
154
US
I want to create recordset from local table with code:

Dim dbs As Database, rstCustomers As Recordset

Set dbs = CurrentDb
Set rstCustomers = dbs.OpenRecordset("Customers")

but as I type "dim dbs as...", in popup menu there is no "Database" option to chose from! If I will type it and try to run, error message is popping up: Compile error: User-defined type not defined.

Thank you for any help.
 
You need a reference to the Microsoft DAO 3.x Object Library. You will need to change that recordset to:

Dim rstCustomers As DAO.Recordset
 
When in VBE menu Tools -> References ..

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top