VBA & Macro Problems

Fix User-Defined Type Not Defined in Access Form Events

Olivia MillerOlivia Miller Nov 20, 2026 869 views

Question details

Resolve a user-defined type error affecting form event procedures in a converted Access database.

Fix User-Defined Type Not Defined in Access Form Events
Product
Microsoft Access
Device & OS
not provided
Scenario
An older MDB database has been converted, and the user needs its form event procedures to work.
Observed behavior
Access reports “User-defined type not defined” when form event procedures are opened, even if the procedures contain simple commands.
Before you start

Make a copy of the database before changing references or repairing code. Note the name of any reference marked MISSING so you can identify or replace the library if the project depends on it.

Solution 1Recommended

Check VBA references and compile the Access project

Use this approach first when a converted database reports a type error across form event procedures.

1
Open the VBA editor

Open the database in Access and press Alt+F11 to open the Visual Basic Editor.

2
Inspect references

In the editor, select Tools > References. Note any library marked MISSING, then clear its checkbox if it is unavailable or no longer needed.

3
Replace required libraries

In Tools > References, select an installed compatible library or use Browse to locate it if the project still depends on the missing reference. Check the library's documentation for compatibility with your Access installation.

4
Compile the project

Select Debug > Compile in the VBA editor. Inspect any highlighted declaration and correct its type or reference, then compile again until the project compiles without errors.

Check VBA references and compile the Access project
Removing a reference may expose other errors: If code uses types from a removed library, install or select the appropriate compatible library or update the declarations before compiling again.
Free Microsoft Office alternative

Work with Office documents in WPS Office

WPS Office is a free, lightweight alternative for everyday document, spreadsheet, and presentation work. Its familiar interface and Office format support help you move compatible files between suites. It does not repair Access VBA references or replace an Access database application.

Edit documents, spreadsheets, and presentations in one familiar suiteOpen and save common Microsoft Office formats, including DOCX, XLSX, and PPTXMove compatible Office files between applications without rebuilding them from scratchUse a lightweight alternative alongside Access when working with exported reports or spreadsheets
microsoft office alternative - wps office

Frequently Asked Questions

Why does a simple Access form event trigger a type error?

VBA may encounter a missing reference or an invalid declaration elsewhere in the project. Open the VBA editor and select Debug > Compile to find the declaration that needs attention.

Where can I find missing VBA references?

Press Alt+F11 in Access, then select Tools > References. Look for libraries marked MISSING and identify whether the project needs a compatible replacement.

How do I connect a form event to its VBA procedure?

Open the form in Design View, select the form or control, and open the Property Sheet. On the Event tab, set the relevant event to [Event Procedure] and click the ellipsis button to open its code.

Will WPS Office fix an Access VBA reference error?

No. Fix the references and code in Microsoft Access. WPS Office can be used separately for compatible Office documents and spreadsheets, but it does not replace an Access database application.