How to Fix Access Form Button Not Opening the Correct Form
Question details
The user needs to fix an Access command button that fails to open the intended form without displaying any error messages.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Clicking a command button on a database form to navigate to or open another specific form.
- Observed behavior
- The command button does not open the correct form, or does nothing at all, and no runtime error is displayed to explain the failure.
Before editing your VBA code or macro settings, create a backup copy of your database file to ensure you do not lose any existing functionality.
Verify VBA Code Syntax and Form Name Properties
Check the VBA event procedure behind the button to ensure the form name and syntax are correctly formatted without typos or unwanted spaces.
A common cause of this issue is a mismatch between the form's actual Object Name and the name used in the VBA code. The code must reference the form's Name property exactly, rather than its Caption.
Right-click the form containing the problematic button in the Navigation Pane and select 'Design View'.
Select the command button, press F4 to open the Property Sheet, go to the 'Event' tab, and click the ellipsis (...) next to the 'On Click' event to open the VBA editor.
Ensure the code reads exactly: `DoCmd.OpenForm "YourFormName"`. Verify that all quotation marks and parentheses are properly placed.
Check the exact Name property of the destination form in its Property Sheet. Ensure there are no unexpected spaces in the form name or within the quotation marks in your code.

Review Embedded Macro Settings
If your database relies on Access Macros instead of VBA code, verify that the macro arguments are correctly configured to point to the right form.
Looking for a Lightweight and Free Office Suite?
While WPS Office does not include a direct database alternative to Microsoft Access, it offers highly compatible, fast, and feature-rich alternatives for Word, Excel, and PowerPoint. If you rely on complex datasets, WPS Spreadsheet provides advanced data management and analysis tools that are easier to set up than a traditional database.
- 1. Download the Installer: Visit the official WPS Office website and download the free installation package.
- 2. Install WPS Office: Run the installer and follow the quick on-screen prompts to set up the software.
- 3. Manage Your Data: Open WPS Spreadsheet to easily import, edit, and analyze your existing tabular datasets.

Frequently Asked Questions
Why does my Access button do nothing when clicked?
This usually occurs if the 'On Click' event is completely blank, the database is stored in an untrusted location that blocks VBA and macros from running, or there is a silent error in the background code. Ensure your database is stored in a Trusted Location.
What is the difference between a form's Name and Caption in Access?
The 'Name' property is the internal identifier used by Access and VBA code (e.g., `EmployeeDetails`), while the 'Caption' is simply the display text shown in the form's title bar (e.g., 'Employee Details Form'). Always use the exact 'Name' in your event procedures.
How can I see hidden error messages in my VBA code?
Open the VBA Editor and add `On Error GoTo ErrorHandler` at the beginning of your procedure. At the end of the procedure (before `End Sub`), add `Exit Sub`, followed by `ErrorHandler:` on a new line, and then `MsgBox Err.Description`. This will display any hidden runtime errors when the code fails.




