VBA & Macro Problems

Fix Access VBA Command Button Doing Nothing When Clicked

Natalie TaylorNatalie Taylor Nov 3, 2026 868 views

Question details

The user needs to fix an MS Access command button that remains unresponsive when clicked.

How to Fix Access VBA Command Button Doing Nothing When Clicked
Product
Microsoft Access
Device & OS
not provided
Scenario
Clicking a command button on an Access form fails to trigger the expected VBA code.
Observed behavior
The command button does nothing upon being clicked because the On Click event is disconnected from its assigned VBA procedure.
Before you start

Ensure that macro settings are enabled in your Access Trust Center, as disabled macros can prevent any VBA code from running regardless of the button's configuration.

Solution 1Recommended

Reconnect the Button to Its Event Procedure

Use this method if your button has lost its link to the underlying VBA code.

In some cases, especially after renaming objects or copying and pasting form elements, a command button can become disconnected from its event procedure. Re-linking it in the Property Sheet resolves the issue.

1
Open Design View

Open your Access database, right-click the form containing the broken button in the navigation pane, and select 'Design View'.

2
Access the Property Sheet

Click on the unresponsive command button to select it, then press F4 or click 'Property Sheet' in the Design tab.

3
Set the On Click Property

Navigate to the 'Event' tab in the Property Sheet, locate the 'On Click' property, and select '[Event Procedure]' from the dropdown menu.

4
Open the VBA Editor

Click the ellipsis (...) button next to the dropdown. This will open the VBA code window to verify your code is correctly linked.

5
Save and Test

Save your form, switch back to Form View, and test the command button to ensure the code executes.

Reconnect the Button to Its Event Procedure
Verify Your Code Block: Once the VBA code window opens, make sure your specific action logic is correctly placed between the 'Private Sub' and 'End Sub' lines for that button.
Free Microsoft Office alternative

Looking for a Lightweight Alternative to Microsoft Office?

While WPS Office does not offer a direct database equivalent to Access, it provides a highly compatible, free alternative for Word, Excel, and PowerPoint. If you frequently struggle with Microsoft Office errors, try WPS Office for a seamless, fast, and familiar experience for your daily document needs.

  1. 1. Download the Installer: Visit the official WPS Office website and download the free installer for your operating system.
  2. 2. Install WPS Office: Run the downloaded file and follow the quick installation prompts.
  3. 3. Open Your Files: Launch WPS Office and instantly open your existing Word, Excel, and PowerPoint documents without losing any formatting.
Fully compatible with Microsoft Word, Excel, and PowerPoint formats (.docx, .xlsx, .pptx).Lightweight design that runs smoothly on almost any device without heavy resource usage.Includes a powerful Spreadsheet tool with advanced formula support for your data tasks.Familiar, tabbed user interface that requires zero learning curve.
microsoft office alternative - wps office

Frequently Asked Questions

Why did my Access command button suddenly disconnect from its VBA code?

This typically happens if the button or the form was copied and pasted, if the button's name was changed in the Property Sheet after the code was already written, or if the database experienced minor structural corruption.

What does the ellipsis (...) button do in the Access Property Sheet?

Clicking the ellipsis button next to an event property like 'On Click' opens the VBA Editor or Macro Builder, taking you directly to the specific code block that is programmed to run when that event is triggered.

Can I use macros instead of VBA for my command button?

Yes, you can choose a predefined Access Macro instead of '[Event Procedure]' in the 'On Click' dropdown if your task involves standard actions (like opening a query or printing a report) and doesn't require complex VBA logic.

Why does my VBA code window open, but the button still doesn't work in Form View?

If the VBA window opens correctly but the button fails in Form View, verify that your code doesn't contain silent errors (like 'On Error Resume Next' masking issues), and ensure your database is stored in a Trusted Location so the code is permitted to run.