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 dbsNew As Database... undefined type???

Status
Not open for further replies.

aqua56

IS-IT--Management
Apr 21, 2002
3
GB
I am trying to create a new recordset from the current database.

When I try to compile after using...

Dim dbsNew As Database
Dim rstItem As Recordset

Set dbsNew = CurrentDb
Set rstItem = dbsNew.OpenRecordset( _
"SELECT * FROM Items")

The compiler throws up an error saying 'user defined type, not defined'

I cannot get it to recognise Dim dbsNew As Database.

Any help appreciated.

 
Hi,

Go into Tools-->References and make sure you have a reference set to "Microsoft DAO (version number here) Objects"

change your code to:

Dim dbsNew As DAO.Database
Dim rstItem As DAO.Recordset Kyle [pipe]
 
Many Thanks

All working fine now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top