Others

Fix a List Box Click Event That Does Not Run in Microsoft Access

Steve KSteve K Nov 14, 2026 868 views

Question details

Determine why a list box Click event does not run the expected VBA code in a Microsoft Access database.

Product
Microsoft Access
Device & OS
not provided
Scenario
A form uses a list box event to run VBA code, potentially to show a button when the list box receives focus.
Observed behavior
The expected code does not execute in one database, although the control names are correct and similar code works in other databases.
Before you start

Open the affected database in Access and identify the form, list box, and event procedure you want to test. If Access displays a security warning, enable content only if you trust the database and its source.

Solution 1Recommended

Verify the List Box Click Event and Test Its VBA Procedure

Use this method to determine whether the Click event is connected and whether its code begins running.

1
Check the event property

Open the form in Design View, select the list box, and open Property Sheet > Event. Set On Click to [Event Procedure] if it is not already selected.

2
Open the procedure

Click the ellipsis button next to On Click to open the corresponding procedure in the VBA editor. Confirm that your code is inside that procedure.

3
Add a test

Click an executable line in the procedure and press F9 to set a breakpoint, or add MsgBox "Click event fired" before the code you want to test.

4
Test in Form View

Switch the form to Form View and click an item in the list box. If the breakpoint or message box appears, the event fired; inspect the subsequent VBA statements and conditions.

Verify the List Box Click Event and Test Its VBA Procedure
If the test does not run: Check whether Access has disabled active content and confirm that the event property points to the intended procedure. Remove the test message or breakpoint after troubleshooting.
Free Microsoft Office alternative

Use WPS Office for Everyday Documents and Spreadsheets

WPS Office is a free, lightweight Office alternative with a familiar interface for working with documents, spreadsheets, and presentations. Its Microsoft Office format support makes it easy to move everyday files, but it does not repair Access databases or replace Access VBA events.

Free, lightweight tools for everyday office workOpen and edit Microsoft Office formats such as DOCX, XLSX, and PPTXUse a familiar interface when moving from Microsoft OfficeWork with spreadsheet data alongside Access-based workflows
microsoft office alternative - wps office

Frequently Asked Questions

How can I tell whether the list box Click event is firing?

In Design View, open the list box's On Click event procedure from Property Sheet > Event. Add a MsgBox at the start or press F9 on an executable line, then test the list box in Form View.

Why should I use On Enter or On Got Focus instead of On Click?

Use a focus event when the action should occur as the list box receives focus, including through keyboard navigation. Set On Enter or On Got Focus to [Event Procedure] on the list box's Event property tab.

Can Access security prevent the VBA event from running?

Yes. Access may disable active content in an untrusted database. Check for a security warning when opening the file and enable content only if you trust the database and its source.

What should I do if the same code works in another database?

Compare the list box's On Click property and event procedure with the working database. If the configuration is correct and the problem persists, create a blank database and import the affected database's objects to test for file corruption.

Can WPS Office fix an Access list box VBA event?

No. The event must be diagnosed in Microsoft Access. WPS Office can be used separately for compatible documents, spreadsheets, and presentations.