Compile error

  • Thread starter Thread starter Dan
  • Start date Start date
D

Dan

Hi;

I have code that is working in one database, but not in
another.

I was unable to convert my project to a .mde because my
database was "corrupted" even though everything seems to
be working fine. I tried Microsoft's
recommended "workaround", but that doesn't seem to work
either. SO, I decided I was going to build a new project
and import all my tables, forms, queries, ect.

PROBLEM: I have code in a module that looks like this:

"Dim dbs As DAO.Database" When this code is invoked at
the project startup I get this message:
"Compile error; User defined type not defined:

This code works in the project that I'm trying to import
the code from. Both projects are standard Office XP VBA
projects.

Anyone have any ideas why I can't make a .mde file of my
project, OR why I am getting this Compile error?

Thanks,
Dan
 
Check your references by opening any code module and clicking
Tools|References. Do you have a reference set to "Microsoft DAO 3.6 Object
Library"? This reference is not set by default in Access 2002 databases
and you must add it yourself. The reference to DAO should resolve the
compile error that you are reporting. When all of your code compiles
without error, try creating your MDE again.

Note, however, that using Access 2002, your database must also be in the
2002 file format to create an MDE.

hth,
 
Thanks Cheryl;

I think you helped me on this on the original project,
but I forgot. Duh.

Dan
 
Back
Top