How to Stop Microsoft Access from Opening VBA Unexpectedly
Question details
The user needs to prevent Microsoft Access from automatically opening the VBA editor when a function is executed, even after previously set breakpoints have been removed.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Running a function or executing code within a Microsoft Access database.
- Observed behavior
- The VBA editor opens unexpectedly on a non-existent breakpoint. Pressing F5 lets the application continue, but the issue returns when the database is reopened.
Ensure you have created a backup copy of your Access database (.accdb or .mdb) before making changes to the compiled code, as altering the VBA project can sometimes lead to data corruption if interrupted.
Force a VBA Project Recompile with a Minor Code Edit
Making a minor change to the VBA code forces Access to update its compiled state, which effectively clears phantom breakpoints.
Microsoft Access sometimes retains obsolete breakpoint information in its compiled code memory even after you clear it visually. By triggering a new save and compile state, you can overwrite this cached error.
Launch your Access database and press ALT + F11 on your keyboard to open the Microsoft Visual Basic for Applications window.
Navigate to the module or function where the unexpected break occurs. Add a minor, non-functional edit, such as inserting a blank space or a line break.
Click 'Debug' in the top menu bar and select 'Compile [Your Project Name]' to rebuild the code without the phantom breakpoint.
Click the Save icon, close Microsoft Access entirely, and reopen your database file to verify that the VBA editor no longer opens unexpectedly.

Decompile the Access Database
If resetting the code doesn't work, decompiling the database will strip out all compiled VBA data, completely removing corrupted breakpoint flags.
Looking for a Lighter, Free Alternative to Microsoft Office?
While WPS Office does not include a direct database clone for Microsoft Access, it is an exceptional, free alternative for Word, Excel, and PowerPoint. If you are tired of heavy applications and recurring subscription fees, WPS Office offers a streamlined experience with excellent macro support for your daily data analysis and documentation needs.
- 1. Download WPS Office: Visit the official WPS website and download the free installation package.
- 2. Install the Software: Run the installer and follow the on-screen instructions to complete the setup.
- 3. Open Your Files: Launch WPS Office and instantly open your existing Excel, Word, or PowerPoint files with perfect formatting.

Frequently Asked Questions
Why does Microsoft Access remember a breakpoint I already deleted?
Access compiles VBA code to run efficiently. Sometimes, the compiled version of the code becomes out of sync with the visible source code, causing it to retain memory of a breakpoint that is no longer visible in the editor.
What does the /decompile switch do in Microsoft Access?
The /decompile command-line switch forces Access to discard all compiled VBA code and save only the plain text source code. This clears out corruptions, phantom breakpoints, and reduces file size before you recompile it.
Will decompiling my Access database delete my tables or queries?
No, decompiling only affects the compiled VBA project data. Your tables, queries, forms, macros, and reports remain intact. However, it is always highly recommended to back up your database before running a decompile to prevent any unexpected data loss.




