Need Help with Compile Error

D

Dale

I have a MS Access 97 database that I converted to MS Access 2000. I am
running this database on a Windows 2000 Professional system. The
database worked fine when it was in 97, but I am now experiencing an
error. My problem is that when I try to open the switchboard I get the
following error message.

Compile Error
User-defined type not defined

When the error occurs, it opens the switchboard module (which was
written by the switchboard manager) and highlights the following lines
of code in yellow:

Dim dbs As database
Dim rst As Recordset

I also get the same error on another portion of the code further on in
the application:

Dim appWord As Word.Application
Dim docWord As Word.Document

Can anyone give me a reason for this or suggest a possible solution to
correct it. Thanks in advance.
 
B

Bill Taylor

It looks like you are missing references to the DAO and Word object models.
Have you opened the VB IDE (ALT F11) and on the tools menu select references
and see if they are missing. If so find microsoft DAO 3.5 and Word 9.0 and
select them. then from the debug menu select compile. That should solve your
problem. You will also want to declare the variable as DAO.recordset.
HTH
 
G

Gary Miller

Dale,

Access97 used DAO exclusively, while Access200 uses ADO as
the default database connection type. Open up any module in
design view and then go to Tools/References. You may find a
DAO reference missing or not. Any way scroll the list and
find the highest number listed for a DAO or Data Object
Reference and select that and see if it doesn't clear up the
problem.

BTW, You may need to change any CurrentDatabase references
to DAO.Database.

Gary Miller
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top