
User Defined Type Not Defined
Did you set a reference to DAO, though, as Cheryl suggested?
With any code module open, select Tools | References from the menu bar,
scroll through the list of available references until you find the one for
Microsoft DAO 3.6 Object Library, and select it. If you're not going to be
using ADO, uncheck the reference to Microsoft ActiveX Data Objects 2.1
Library
If you have both references, you'll find that you'll need to "disambiguate"
certain declarations, because objects with the same names exist in the 2
models. For example, to ensure that you get a DAO recordset, you'll need to
use Dim rsCurr as DAO.Recordset (to guarantee an ADO recordset, you'd use
Dim rsCurr As ADODB.Recordset)
The list of objects with the same names in the 2 models is Connection,
Error, Errors, Field, Fields, Parameter, Parameters, Property, Properties
and Recordset
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
Quote:
> Thanks for the quick reply Cheryl;
> I tried it:
> Dim dbs as DAO.Database
> Dim dbs as DAO.TableDef
> I still get the same message both places. I hope you can
> think of something else.
> Thanks,
> Dan
> >-----Original Message-----
> >Hi Dan,
> >Missing a reference to DAO 3.6? Or, maybe you've got
> references to both
> >DAO and ADO and you might want to dim your database and
> tabledef as:
> >Dim dbs as DAO.Database
> >Dim tdf as DAO.TableDef
> >hth,
> >--
> >Cheryl Fischer
> >Law/Sys Associates
> >Houston, TX
> >> Hi;
> >> This is probably another really stupid question and I'm
> >> going to feel really stupid AGAIN! Anyway, I got some
> >> code that re-links my database FE and BE. When I
> compile
> >> it I get these messages:
> >> Dim dbs As Database
> >> "User defined type not defined"
> >> Dim tdf As TableDef
> >> "User defined type not defined"
> >> I'm developing in Access 2002 using Windows and Office
> >> XP. Any help will be greatly appreciated.
> >> Thanks,
> >> Dan
> >.