Others

How to Stop Microsoft Access from Opening VBA Unexpectedly

Amos GikundaAmos Gikunda Oct 26, 2026 868 views

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.

How to Stop Microsoft Access from Opening VBA Unexpectedly
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.
Before you start

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.

Solution 1Recommended

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.

1
Open the VBA Editor

Launch your Access database and press ALT + F11 on your keyboard to open the Microsoft Visual Basic for Applications window.

2
Edit the Code Slightly

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.

3
Compile the Project

Click 'Debug' in the top menu bar and select 'Compile [Your Project Name]' to rebuild the code without the phantom breakpoint.

4
Save and Restart

Click the Save icon, close Microsoft Access entirely, and reopen your database file to verify that the VBA editor no longer opens unexpectedly.

Force a VBA Project Recompile with a Minor Code Edit
Quick Fix: For many users, this simple edit-and-compile method is enough to permanently clear the stuck breakpoint.
Free Microsoft Office alternative

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. 1. Download WPS Office: Visit the official WPS website and download the free installation package.
  2. 2. Install the Software: Run the installer and follow the on-screen instructions to complete the setup.
  3. 3. Open Your Files: Launch WPS Office and instantly open your existing Excel, Word, or PowerPoint files with perfect formatting.
Fully compatible with Microsoft Office formats (.docx, .xlsx, .pptx).Includes a robust spreadsheet tool with advanced VBA/macro support for automation.Lightweight design that loads quickly without consuming excessive system resources.Familiar user interface ensuring a seamless migration.
microsoft office alternative - wps office

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.