How to Fix The Object Does Not Contain the Automation Object in Microsoft Access
Question details
The user encounters an automation object error when attempting to open a form for a many-to-many relationship using a command button.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Clicking a button created with the button wizard to open a specific database form.
- Observed behavior
- Microsoft Access fails to open the form and displays the error message: "The object does not contain the automation object."
Before troubleshooting the button code, attempt to open the target form directly from the Navigation Pane to verify that the form itself is not corrupted or missing.
Verify and Compile VBA Code and Macros
Check the code generated by the button wizard for incorrect object references or missing automation libraries, which are the primary causes of this error.
When the Command Button Wizard generates a macro or VBA code, it relies on specific library references and exact form names. If a form was renamed or a library is missing, the automation object error will trigger.
Right-click the problematic form in the Navigation Pane and select "Design View". Click the malfunctioning button, open the Property Sheet (F4), and navigate to the "Event" tab.
Click the ellipsis (...) next to "On Click". If it's a macro, verify that the "OpenForm" action points to the exact correct form name. If it's VBA, ensure the form name in the DoCmd.OpenForm statement matches your form.
Press ALT + F11 to open the VBA Editor. From the top menu, click "Debug" and select "Compile Database". Access will highlight any broken references or syntax errors that need to be corrected.
While still in the VBA Editor, click "Tools" > "References". Look for any checked items that start with "MISSING:". Uncheck these boxes or browse to locate the missing files, then click "OK".

Recreate the Command Button
If you are unfamiliar with VBA, deleting and recreating the button using the wizard can automatically repair broken background macros.
Try WPS Office for Your Daily Document, Spreadsheet, and Presentation Needs
While Microsoft Access is designed for complex relational databases, WPS Office provides a free, lightweight, and highly compatible alternative for handling all your daily word processing, spreadsheet data analysis, and presentation tasks without expensive subscriptions.
- 1. Download WPS Office: Visit the official WPS Office website and download the free installation package for your operating system.
- 2. Install and Launch: Run the installer. Once installed, open WPS Office to access Writer, Spreadsheets, Presentation, and PDF tools from one unified dashboard.
- 3. Work with Microsoft Formats: Open your existing Word, Excel, or PowerPoint files directly in WPS Office. All edits will save in fully compatible formats.

Frequently Asked Questions
Why does Microsoft Access say 'The object does not contain the automation object'?
This error typically occurs when a macro or VBA code attached to a button references a missing automation library, an incorrectly named form, or an object that has been deleted or renamed in the database.
How do I fix missing library references in Microsoft Access?
Press ALT + F11 to open the VBA Editor, go to Tools > References, and look for any checked items labeled 'MISSING'. Uncheck them or browse for the correct file location to resolve the reference issue.
Can I fix a broken form button without writing VBA code?
Yes. You can switch your form to Design View, delete the malfunctioning button, and use the Command Button Wizard to draw a new one. The wizard will automatically generate a fresh, correctly configured embedded macro to open your form.




