logo
search
Office Apps Not Opening

How to Fix Microsoft Access Runtime Error: OpenForm Action Was Canceled

John WilsonJohn Wilson Oct 1, 2026 868 views

Question details

The user is experiencing an 'OpenForm action was canceled' runtime error when attempting to open a dashboard form from a login form using VBA in Microsoft Access.

Fixing Microsoft Access Runtime Error: OpenForm Action Was Canceled
Product
Microsoft Access
Device & OS
not provided
Scenario
Opening a dashboard form using VBA after completing a login procedure.
Observed behavior
The OpenForm action fails and is canceled, preventing the destination dashboard form from opening as intended.
Before you start

Ensure you have access to the VBA editor in your Microsoft Access database and create a backup of your database file before making any modifications to the form's code.

Solution 1Recommended

Inspect and Modify the Dashboard Form Event Code

Identify and resolve code blocks in the target form that might be intentionally or accidentally canceling the form opening process.

Often, the error is not located in the login form's code, but rather in the destination (Dashboard) form. If the destination form has validation failures, contains runtime-incompatible code, or explicitly sets the Cancel parameter to True during its initialization, the OpenForm action will fail.

1
Open the VBA Editor

Right-click the Dashboard form in the Access Navigation Pane, select 'Design View', and then click 'View Code' from the Design tab in the ribbon.

2
Check the Form_Open Event

Locate the 'Private Sub Form_Open(Cancel As Integer)' procedure. Check if there are any conditions, validation checks, or statements that execute 'Cancel = True'.

3
Temporarily Comment Out Code

To isolate the issue, type an apostrophe (') before the lines of code in the Form_Open and Form_Load events to temporarily comment them out. Save your changes and try opening the form again.

4
Fix Compatibility Issues

If the form opens successfully after commenting out the code, review the disabled lines to find runtime-incompatible operations and rewrite the failing procedure to ensure it functions correctly.

Inspect and Modify the Dashboard Form Event Code
Runtime Environment Considerations: Keep in mind that certain VBA commands or design-view operations might work in the full version of Access but will throw an error and cancel operations in an Access Runtime environment.
Free Microsoft Office alternative

Looking for a Free and Lightweight Office Alternative?

While Microsoft Access handles complex database management, WPS Office provides an excellent, free alternative for your daily document, spreadsheet, and presentation tasks. It offers high compatibility with Microsoft Office formats without the hefty subscription fees.

  1. 1. Download the Installer: Visit the official WPS Office website and click the free download button.
  2. 2. Install WPS Office: Run the downloaded installation file and follow the on-screen instructions to set up the software.
  3. 3. Open Your Documents: Launch WPS Office and easily open or edit your existing Microsoft Office files with full format retention.
Free and lightweight Office suite for everyday tasksFully compatible with Microsoft Word, Excel, and PowerPoint formats (.docx, .xlsx, .pptx)Familiar user interface ensuring a seamless transition and zero learning curveBuilt-in PDF editing tools for comprehensive document management
microsoft office alternative - wps office

Frequently Asked Questions

Why does the OpenForm action get canceled in Access VBA?

This usually occurs because the VBA code within the target form's Form_Open or Form_Load events explicitly halts the opening process (e.g., setting 'Cancel = True'), or the form encounters an unexpected validation failure or runtime error.

How do I find the code that is causing the OpenForm error?

You need to open the Access database in Design View, access the VBA Editor by clicking 'View Code', and specifically inspect the event procedures of the target form you are trying to open, rather than just checking the form that triggered the action.

Will this error occur if my database is run in Access Runtime?

Yes. Some VBA methods and operations are not allowed in the restricted Access Runtime environment. If the target form contains incompatible code, the operation will fail and cancel the form opening.