The reference to the Microsoft DAO 3.6 Library is not, by default, set in
Access 2000 and later versions -- the ADO reference is set by default. So
what you most likely need to do is open a module, and in the module window's
menu, Tools | References, find that library, check it, _and_ just to be on
the safe side, move it above the ADO reference in the list. And, make it a
practice to qualify references to DAO objects as in
Dim rs as DAO.Recordset
Dim td as DAO.TableDef
because some object names are both in DAO and ADO and you should keep them
clearly separate so you, or someone else, doesn't get confused reading the
code later. "Database" is not an object in the ADO library, so it didn't
confuse it, it just didn't know what it is without the DAO library being
referenced.
Larry Linson
Microsoft Access MVP
"Monte" <j.*****@earthlink.net> wrote in message
news:RI*****************@newsread4.news.pas.earthl ink.net...
It compiles fine in one of my ms2002 databases, but on another db (I
inherited from somebody else), I get this compile error: "User-defined
type not defined"
Is something turned off in this second db or something? Thanks much