Office Settings & Configuration

Open a Microsoft Access Form from a List Box Selection

Tauseeq MagsiTauseeq Magsi Nov 22, 2026 868 views

Question details

Open an Access form to the record selected in a list box, using either a numeric ID or a text field as the filter.

Open an Access Form from a List Box Selection
Product
Microsoft Access
Device & OS
not provided
Scenario
A user selects an item in a list box and wants to display its matching record on another form.
Observed behavior
The target form should open with a filter that matches the selected list box value to the appropriate field.
Before you start

Check the list box's Bound Column and Row Source in its Property Sheet, and confirm that the target form's Record Source contains the field you want to filter. Replace the example control, field, and form names with the names in your database.

Solution 1Recommended

Open the form using the selected numeric ID

Use the list box's bound ID to find the matching record without relying on a potentially duplicated name.

1
Check the bound column

Open the source form in Design View, select the list box, and open Property Sheet > Data. Set Bound Column to the column containing StrainID, and verify that the target form's Record Source includes the same numeric field.

2
Create the event procedure

On the list box's Property Sheet, open the Event tab. Next to After Update, choose [Event Procedure] and select the ellipsis button to open the VBA editor.

3
Add the filter and open the form

Inside the event procedure, enter: If Not IsNull(Me!lboStrain.Value) Then DoCmd.OpenForm "frmStrain", WhereCondition:="[StrainID] = " & Me!lboStrain.Value End If

4
Test the selection

Save the form, switch to Form View, and select a list box item. Confirm that frmStrain opens to the record with the selected StrainID.

Open the form using the selected numeric ID
Use the bound value: The list box may display a strain name while returning a hidden ID. The filter must match the bound value's data type and the corresponding field in the target form's Record Source.
Free Microsoft Office alternative

Work with exported Access data in WPS Office

WPS Office is a free, lightweight alternative for working with office files in a familiar interface. Export Access data to Excel to review it in WPS Spreadsheets. WPS does not run Access forms or fix Access VBA, so keep using Access for this form workflow.

Review and filter exported Access records in WPS SpreadsheetsOpen and edit Microsoft Excel XLSX filesUse a familiar interface for a smoother move from Microsoft OfficeWork with a free, lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

Why does Access report a data type mismatch in the filter?

The filter may be comparing a numeric field with text or a text field with an unquoted value. Check the list box's Bound Column under Property Sheet > Data and use a field of the same data type in the target form's Record Source.

Can the list box show a name but use the ID to open the form?

Yes. Include both fields in the list box's Row Source, set Bound Column to the ID column, and adjust Column Widths in the Property Sheet to hide the ID if desired. The displayed name can then differ from the numeric value used in the filter.

What if a strain name contains an apostrophe?

A text criterion must escape apostrophes within the value. The text solution uses Replace to double each apostrophe before passing the criterion to DoCmd.OpenForm.

Why does the form show more than one matching record?

A text field such as StrainName may contain duplicates. Use a unique StrainID as the list box's bound value and filter the target form on that numeric field.