VBA & Macro Problems

Fix the Microsoft Access “Macros Can Only Be Run 19 Times” Error

Aamir Naveed AkramAamir Naveed Akram Nov 20, 2026 869 views

Question details

The user needs to resolve an Access error that appears when form controls repeatedly run embedded macros.

Fix the Microsoft Access “Macros Can Only Be Run 19 Times” Error
Product
Microsoft Access
Device & OS
not provided
Scenario
A user navigates between forms or performs other actions using buttons that call embedded macros.
Observed behavior
Access displays a “Macros can only be run 19 times” error after repeated macro calls.
Before you start

Identify the buttons and form events involved when the error appears. Open the affected form in Design View and note what each embedded macro does before replacing it.

Solution 1Recommended

Replace Embedded Macros with VBA Event Procedures

Use VBA event procedures for the affected form controls instead of repeatedly calling embedded macros.

1
Open the form in Design View

In the Navigation Pane, right-click an affected form and select Design View.

2
Inspect the control event

Select the affected command button, open the Property Sheet, and choose the Event tab. Find the event that shows Embedded Macro, such as On Click.

3
Create an event procedure

Change the event property to [Event Procedure], then click the adjacent ellipsis button to open the VBA editor. If prompted, choose Code Builder.

4
Recreate the macro actions

In the generated event procedure, write VBA that performs the original macro's actions, such as opening the intended form. Remove any calls to the original macro if they are no longer needed.

5
Repeat and test

Save the form, repeat the process for other affected controls, and switch to Form View. Click the buttons and navigate between forms repeatedly to check whether the error returns.

Replace Embedded Macros with VBA Event Procedures
Preserve the original behavior: Changing an event property to [Event Procedure] does not automatically convert the embedded macro. The VBA procedure must implement the actions the macro performed.
Free Microsoft Office alternative

Use WPS Office for Everyday Office Documents

WPS Office is a free, lightweight alternative for working with documents, spreadsheets, and presentations. Its familiar interface and Microsoft Office format support make it easy to move everyday files. It does not fix Access errors or replace Access database forms and VBA.

Work with documents, spreadsheets, and presentations in one familiar interfaceOpen and edit common Microsoft Office formats, including DOCX, XLSX, and PPTXUse a free, lightweight alternative for everyday Office tasksKeep Access database troubleshooting separate from your document and spreadsheet work
microsoft office alternative - wps office

Frequently Asked Questions

How do I make an Access button use VBA instead of an embedded macro?

Open the form in Design View, select the button, and open Property Sheet > Event. Set On Click to [Event Procedure], click the ellipsis button, and write VBA that reproduces the macro's actions.

Why does the error still appear after I convert a macro to VBA?

Another control or form event may still invoke an embedded macro, or an event may repeatedly trigger another action. Check the Event tab for both the form and its controls, then trace relevant VBA procedures with breakpoints.

Does navigating between two forms have a 19-run VBA limit?

The reported error does not establish a general 19-run limit for VBA navigation. If the issue occurs during navigation, inspect the forms' event properties and check for repeated or recursive calls.

Will WPS Office repair my Access database or run its forms?

No. WPS Office is an alternative for documents, spreadsheets, and presentations; it does not repair Access databases or replace Access forms and VBA. Use Microsoft Access to inspect and update the database events.