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

Compile Error 1

Status
Not open for further replies.

perrymans

IS-IT--Management
Nov 27, 2001
1,340
US
Compile Error:
User Defined Type not Defined

This error comes up on the line

Dim db As Database

When I retype the line, the drop-down list does not include "Database".

What is going on?

I suspect I may get the answer that I don't have the right libraries referenced. How do I acquire/install/reference more libraries? I kow there are alot, so should I check them all?

Thanks. Sean.
 
I'll guess you're using Access 2000, in which case you need to define which kind of database it is:

DAO.Database
ADO.Database
 
Duh?

Do you mean I need to tell you (I don't know, or know how to tell) or is that definition an option I need to select somewhere?

Thanks. Sean.
 
While in some vba code go up to the menubar and select tools and under tools references. Find a DAO library - probably Microsoft DAO 3.6 and then check it.
 
Thanks cmmrfrds! That did it for me. How do I know which of these references I should select?

Thanks again. Sean.
 
Usually, if you are adding some additional functionality to the Access program that is not built in, such as, if you wanted to read/manipulate the directory structure on the PC, then you could add the Runtime Scripting object. In the case of the DAO library, it was included by default prior to Access 2000. Starting with 2000, Microsoft encourages the use of ADO data objects and does not default the DAO library.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top