Others

Fix a Microsoft Access Combo Box Opening the Wrong Record

Natalie TaylorNatalie Taylor Nov 27, 2026 869 views

Question details

Prevent a search combo box from navigating an Access form to the wrong record when its value is empty or does not match a record.

Fix a Microsoft Access Combo Box Opening the Wrong Record
Product
Microsoft Access
Device & OS
not provided
Scenario
A user selects a value in a form's search combo box to find and display a matching record.
Observed behavior
The form can display the first record when the combo box is Null or the code checks EOF instead of confirming that FindFirst found a match.
Before you start

Open the form in Design View and identify the search combo box, its bound column, and the matching field in the form's record source. The example below assumes the bound value and Interment_ID are numeric.

Solution 1Recommended

Check for Null and NoMatch before changing the form record

Use a DAO RecordsetClone to navigate only when the combo box contains a value and FindFirst finds a matching record.

FindFirst sets NoMatch when it cannot find a record; EOF is not the appropriate test for this result. Avoid using Nz to convert an empty selection to zero, because zero could be treated as a search value.

1
Open the combo box event

In Access, open the form in Design View, select the search combo box, and open its Property Sheet. On the Event tab, set After Update to [Event Procedure] and click the ellipsis button.

2
Add the search code

In the VBA editor, replace the event procedure's body with the following code, keeping the existing procedure declaration and End Sub: Dim rs As DAO.Recordset If Not IsNull(Me!ComboFindInternee) Then Set rs = Me.RecordsetClone rs.FindFirst "[Interment_ID] = " & Me!ComboFindInternee If Not rs.NoMatch Then Me.Bookmark = rs.Bookmark rs.Close Set rs = Nothing End If

3
Adapt the names and test

Replace ComboFindInternee and Interment_ID with your combo box and field names if they differ. Save the form, open it in Form View, and test a matching selection, a cleared selection, and an unmatched value.

Check for Null and NoMatch before changing the form record
Check the bound value: This code searches for a numeric ID. If the combo box is bound to a text value, the FindFirst criteria must quote and escape that text instead.
Free Microsoft Office alternative

Work with Office documents using WPS Office

WPS Office is a free, lightweight Office alternative with a familiar interface and support for common Microsoft Office formats, making it easy to move everyday document, spreadsheet, and presentation work. It does not fix Access forms or replace Access database functionality.

Edit and review spreadsheets related to your database work.Open and save common Microsoft Office formats, including DOCX, XLSX, and PPTX.Use familiar document, spreadsheet, and presentation tools in one application.Move everyday Office file workflows without a subscription.
QA img-9

Frequently Asked Questions

Why should I use NoMatch instead of EOF after FindFirst?

FindFirst sets the recordset's NoMatch property when no record meets the criteria. Check If Not rs.NoMatch before assigning rs.Bookmark to the form.

What happens when the combo box is cleared?

The IsNull check skips FindFirst and leaves the form on its current record. This avoids converting an empty value to zero or building invalid numeric search criteria.

Where do I put the VBA code?

Open the form in Design View, select the combo box, and use Property Sheet > Event > After Update > [Event Procedure]. Click the ellipsis button to open the VBA editor.

Can I use this code to search for a text ID?

The example assumes a numeric bound value. For a text ID, build FindFirst criteria with the value enclosed in quotes and escape any quote characters within the value.