Compile Error: User-defined type not defined

  • Thread starter Thread starter grapisarda
  • Start date Start date
G

grapisarda

Guest
I am trying to compile an access 2000 db and keep receiving a "User-defined type not defined" error. I am used to the compiler highlighting the code syntax that is causing the error, but nothing is highlighted. Any ideas what I might be doing wrong?

Thanks!
 
g,

Search the forum here for "references" ... common problem.

Wayne
 
Sorry but I've searched the forum and can't seem to find any posts that match my specific problem. I've double checked all of my references. De-selected and re-selected each. I've no ADO code so I only have the DAO 3.6 Object Library reference. Here is the complete list of my references:

Visual Basic for Applications
Microsoft Access 9.0 Object Library
Microsoft DAO 3.6 Object Library
Sagekey Security (I've checked and the ocx is installed in the right place)
Microsoft Office 9.0 Object Library
Microsoft CDO1.21 Library
Microsoft Outlook 9.0 Object Library
OLE Automation

This would be alot easier if I knew what code was generating the error, but nothing is getting highlighted when the compile error occurs.

Any help would be greatly appreciated
 
grapisarda said:
but nothing is getting highlighted when the compile error occurs.
Strange...
You can try to import everything in a new database and then compile again?
Personally I compile my code very frequently (after a couple of changes), so that I know whát I've changed.
 
Good Call

Database was corrupted. Good call. Thanks all!
 
Just wanted to share my solution to the problem. I was getting the same "Compile Error: User-defined type not defined" when it his this part of my script:

Dim OutlookApp As Outlook.Application

The problem was that I did not have the correct reference for Outlook. However, when I looked through the reference list, I did not see anything for Outlook.

I happened to read an article on the Microsoft support site that said "If the Microsoftw Outlook Object Library is not listed under Available Referenced, click "Browse" to locate the MSOUTL.OLB file. It is located by default in the C:\program files (x86)\Microsoft Office\Office folder.

I was able to locate the above file and voila, a reference was created to the "Microsoft Outlook 12.0 Object Library" that was not their before.

Completely solved my "User-defined type not defined" error!!!

Hope this helps!
 

Users who are viewing this thread

Back
Top Bottom