You receive a "User-defined type not defined" error message when you compile or run VBA code in Access 2002 (289664)
The information in this article applies to:
This article was previously published under Q289664 Moderate: Requires basic macro, coding, and interoperability
skills. This article applies to a Microsoft Access database (.mdb) and to a
Microsoft Access project (.adp).
For a Microsoft Access 97 version of this article, see 182342.
For a Microsoft Access
2000 version of this article, see
202192. SYMPTOMS When you compile or run code, you may receive the following
error message: Compile Error: User-defined type not
defined. CAUSE You are referring to an object in an object library that
you do not have referenced. RESOLUTION You must add a reference to the object library that
contains the object that you are using in code. To do so, follow these steps:
- Open any module in the database that is generating the
error that is described in the "Symptoms" section of this article.
- On the Debug menu, click Compile <database name>. Note the line of code that is highlighted when you receive the
error message.
- On the Tools menu, click References.
- Click to select the object library that contains the object
that is referenced by the line of code that is highlighted.
REFERENCESFor more information about ActiveX Data
Objects (ADO), in the Visual Basic Editor, click Microsoft Visual Basic Help on the Help menu, type ActiveX Data Objects in the Office Assistant or the Answer Wizard, and then click Search to view the topic.
Modification Type: | Major | Last Reviewed: | 8/12/2004 |
---|
Keywords: | kberrmsg kbprb KB289664 |
---|
|