logo
search
Others

How to Show an Access Text Box Based on a List Box Selection

John WilsonJohn Wilson Oct 1, 2026 868 views

Question details

The user needs to display a conditionally hidden text box when selecting 'other' from a list box in an MS Access form.

How to Show a Text Box Based on a List Box Selection in Access
Product
Microsoft Access
Device & OS
not provided
Scenario
Creating a dynamic MS Access form where specific controls become visible based on a user's selection in a list box.
Observed behavior
The After Update VBA event runs without errors, but the targeted text box remains invisible despite selecting 'other' in the list box.
Before you start

Ensure you have design permissions for the Access form and that macros or VBA code execution are enabled in your database Trust Center settings.

Solution 1Recommended

Verify List Box Bound Column and Simplify VBA Code

Check if the list box is returning the expected text value and use a streamlined VBA condition in the After Update event.

Often, the VBA code is structurally correct, but the list box returns a numeric ID instead of the text 'other'. This occurs because the Bound Column property is set to an ID field rather than the text field.

1
Open Property Sheet

Open your Access form in Design View, select the list box control, and press F4 to open the Property Sheet.

2
Check Bound Column

Navigate to the Data tab and check the 'Row Source' and 'Bound Column' properties. Confirm that the text 'other' is actually the value stored in the bound column (e.g., if 'other' is in the second column, Bound Column should be 2).

3
Edit VBA Code

Switch to the Event tab, find the 'On After Update' property, and click the ellipsis (...) to open the VBA editor.

4
Apply Simplified Logic

Update your VBA procedure to: Me.TxtYourTextBoxName.Visible = (Me.lstYourListBoxName = "other"). Ensure you replace the placeholder names with your actual control names.

Verify List Box Bound Column and Simplify VBA Code
Use Meaningful Names: Rename your controls to meaningful names (e.g., lstOptions instead of List0) before writing VBA code. This prevents confusion and makes your logic much easier to debug.
Free Microsoft Office alternative

Looking for a Free, Lightweight Office Alternative?

While Microsoft Access handles complex relational databases, for most everyday data management, tracking, and reporting needs, WPS Spreadsheet offers a lightweight and highly compatible solution without the hefty subscription fees.

  1. 1. Download and Install: Visit the official WPS website to download and install the free suite on your device.
  2. 2. Open WPS Spreadsheet: Launch WPS Office and open Spreadsheet to start managing your data lists.
  3. 3. Import Existing Data: Easily open your exported CSV or Excel files directly in WPS Spreadsheet to continue working.
Highly compatible with Microsoft Office formats including Excel (XLSX), Word, and PowerPoint.Easily manage lists, filter data, and apply conditional formatting for dynamic data tracking.Lightweight design that installs quickly and runs smoothly on most devices.Familiar user interface allowing for a seamless transition from other Office suites.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my VBA code run but the text box visibility doesn't change?

This usually happens when the condition in your VBA code evaluates to False. In list boxes, it is often because the bound column contains a numeric ID rather than the exact text string (like 'other') you are checking against.

How do I find the exact name of my text box or list box in Access?

Open the form in Design View, click on the specific control, and look at the 'Name' property located at the very top of the Property Sheet under the 'All' or 'Other' tab.

Can I show or hide multiple controls based on one list box selection?

Yes. You can add multiple lines inside the same After Update event procedure, setting the .Visible property to True or False for each individual control based on the evaluated list box value.