How to Fix Access DLookup and Automatically Display a Combo Box Value
Question details
The user needs to automatically display related data, such as an employee name, in a text box immediately after selecting an ID from a combo box in an Access form.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Building or modifying a Microsoft Access form to automatically populate related text fields based on a user's combo box selection.
- Observed behavior
- The text box fails to display the desired text, or a #Name? error occurs when the DLookup criteria syntax is formatted incorrectly for numeric or text values.
Ensure your Microsoft Access form is open in Design View, and verify that the record source for your combo box includes both the ID field and the text field you want to display.
Use the Combo Box Column Property (Recommended)
The most efficient way to display related data is to bind multiple columns to the combo box and reference the desired column directly, avoiding complex DLookup functions.
By adjusting the Row Source and Column Widths, you can hide the ID column from the user while still using it as the bound value. A separate text box can then read the hidden name column directly.
Select the combo box in Design View. In the Property Sheet under the Data tab, set the Row Source to a query or table that includes both the ID and the Name fields.
Switch to the Format tab. Set 'Column Count' to 2. Set 'Column Widths' to 0;2 (or similar) so the first column (ID) is hidden and the second column (Name) is visible.
Select the text box where the name should appear automatically. In the Data tab, set its Control Source to =IDNumberCombo.Column(1). Note that Microsoft Access column indexes start at 0, so Column(1) refers to the second column.

Correct the DLookup Function Syntax
If your form requires the use of DLookup, you must ensure your criteria string is correctly formatted based on whether the ID is a text or numeric data type.
Manage Your Exported Access Reports Seamlessly with WPS Office
While Microsoft Access handles your databases, you need a robust office suite to format exported reports, analyze data, and prepare presentations. WPS Office provides a lightweight, entirely free alternative to Microsoft Office.
- 1. Visit the Official Website: Go to the official WPS website to find the free installer for your operating system.
- 2. Download the Installer: Click the free download button to safely get the lightweight installation file.
- 3. Install and Edit: Run the setup file. Once installed, you can immediately open and edit your exported data sheets and documents.

Frequently Asked Questions
Why does my DLookup expression show a #Name? error?
This error occurs when Microsoft Access cannot recognize a name used in your expression. It usually means the field name, table name, or control name is misspelled, or text values in the criteria string are not properly enclosed in quotation marks.
How do I hide the ID column in an Access combo box?
You can easily hide the ID column by modifying the Column Widths property located in the Format tab of the combo box's Property Sheet. Set the width of the first column to 0 (for example, '0;2' or '0cm;5cm').
Why does =Combo.Column(1) display the second column instead of the first?
In Microsoft Access, the Column property uses a zero-based index. This means Column(0) refers to the very first column in your Row Source, and Column(1) refers to the second column.




