logo
search
Office Settings & Configuration

Fix Microsoft Access Command Buttons Not Working

Steven ParkerSteven Parker Oct 19, 2026 868 views

Question details

The user needs to troubleshoot and fix command buttons in Microsoft Access forms or reports that fail to execute their assigned event procedures, such as running VBA code or exporting to PDF.

How to Fix Microsoft Access Command Buttons Not Working
Product
Microsoft Access
Device & OS
not provided
Scenario
Clicking a command button in an Access form or report to trigger a specific VBA event procedure or PDF export routine.
Observed behavior
The command button fails to run the procedure, triggers a syntax or missing reference error, or silently stops executing during a PDF output task.
Before you start

Ensure you create a backup copy of your Microsoft Access database file (.accdb) before altering VBA code, modifying form structures, or compiling the project.

Solution 1Recommended

Verify Event Properties and Compile VBA Code

Check the button's On Click property and resolve any syntax or reference errors in the VBA Editor to ensure the code can run properly.

A common reason buttons fail is that the form's property sheet is disconnected from the VBA code, or the code itself has syntax issues blocking execution.

1
Check the On Click Property

Open the form or report in Design View, select the malfunctioning command button, and ensure the 'On Click' property in the Property Sheet is set exactly to [Event Procedure].

2
Verify Procedure Names

Click the ellipsis (...) next to [Event Procedure] to open the VBA Editor. Confirm that the subroutine name matches the button's actual control name.

3
Compile the Database

In the VBA Editor menu, click 'Debug' > 'Compile [Project Name]'. If Access highlights any code, fix the syntax error or missing reference, then save.

4
Test in Form View

Return to your Access database window, switch the form from Design View to Form View, and click the button to test its functionality.

Verify Event Properties and Compile VBA Code
Free Microsoft Office alternative

Discover WPS Office for Your Data and Document Needs

While Microsoft Access manages complex databases, WPS Office is an exceptional, free alternative for your everyday document, spreadsheet, and presentation tasks. It is incredibly lightweight, highly compatible with Microsoft formats, and provides a familiar tabbed interface to help you stay productive without the heavy subscription costs.

Highly compatible with Microsoft Excel, Word, and PowerPoint formats.Free and lightweight alternative to heavy Microsoft Office installations.Powerful spreadsheet capabilities for robust data management and analysis.Familiar, user-friendly tabbed interface for seamless migration.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my Access button work in the VBA editor but not on the form?

This usually happens because the button's 'On Click' property in the Property Sheet is empty instead of being set to [Event Procedure]. Without this setting, Access does not know it should trigger the VBA code when clicked.

What does the 'missing reference' error mean in Access VBA?

It means your database is trying to use an external library or object model that isn't available on your current PC. Open the VBA Editor, go to Tools > References, and uncheck any items marked as 'MISSING' to resolve compile issues.

Can I export multiple Access reports to a single PDF using a command button?

Yes. You can achieve this by using a multi-select list box to gather parameters, looping through the selected items in VBA, and modifying the report's RecordSource query before calling the OutputTo method.

Why does my command button do nothing in Design View?

Command buttons and their associated event macros are intentionally deactivated in Design View so developers can safely move and edit them. You must switch to Form View or Report View to test button functionality.