Compiler Error User-Defind Type Not Defined
for-
Dim dbCurr As Database, dbLink As Database
Dim tdfLocal As TableD
In Access 2000 and 2002, only the ADO Reference is set by default, so a
Recordset would be assumed to be an ADO Recordset. Obviously you mean to use
DAO, in which there is a Database object (there's no Database object in ADO,
and that's why Access is assuming it's "user defined" -- there's no such
object in any of the default References nor built in to Access itself).
Open any module, and on the module window menu, Tools, References, scroll
down to Microsoft Data Access Objects 3.6, check the box. Then, if you are
mostly using DAO code (as you are in your post), move that reference up
higher than the ADO reference just in case. Then, go into your code and
qualify all the DAO objects with DAO.<object> in the Dims... e.g.
Dim rs as DAO.Recordset
You could get by without qualifying "Database" as there is no corresponding
ADO "Database" object to confuse, but I'd recommend using the "DAO." prefix
even there, just for clarity.
(If you've just moved to the newer version from Access 97 or earlier, you
are used to having the DAO reference checked by default, and no ADO
reference. Thus, you didn't have to qualify the Dim's, because the only
Library referenced with any objects by those names is DAO.)
Larry Linson
Microsoft Access MVP