Others

Insert an Item Code into a Microsoft Access Subform Using a Combo Box

Jason MillerJason Miller Nov 13, 2026 869 views

Question details

Select a stock item by its description and save its item code in the related stock details record through a Microsoft Access subform.

Product
Microsoft Access
Device & OS
not provided
Scenario
An inventory database uses a catalog of stock items and a stock details subform. The user wants to search descriptions and choose the item needed for a stock transaction.
Observed behavior
The desired behavior is for an item selection to populate the item-code foreign key in the current stock details record.
Before you start

Identify the catalog's unique item-code field and the matching foreign-key field in the stock details table; their data types must be compatible. Confirm that the stock details subform has an editable Record Source containing that foreign-key field.

Solution 1Recommended

Bind a description combo box to the stock details item-code field

Use this approach to display item descriptions while saving the selected item code directly in the current subform record.

A combo box can display one column and store another. Its Row Source supplies the available items, its Bound Column determines the returned value, and its Control Source identifies the field that receives that value.

The table and control names below are examples. Replace them with the names used in your database.

1
Check the item relationship

Open Database Tools > Relationships. Verify that Catalog.ItemCode is a primary key or uniquely indexed field and that StockDetails.ItemCode is the related foreign key. If the catalog key is AutoNumber, the corresponding foreign key should normally be Number with Field Size set to Long Integer.

2
Add a combo box to the subform

Open the stock details subform in Design View. On the Design tab, select Combo Box and place it in the Detail section. If the wizard opens, choose to get values from a table or query, select the catalog, include ItemCode and ItemDescription, and choose to store the selected value in the stock details ItemCode field.

3
Set the control and row sources

Select the combo box and press F4 to open the Property Sheet. Set its Name to cboItem, Control Source to ItemCode, and Row Source Type to Table/Query. Set Row Source to: SELECT [ItemCode], [ItemDescription] FROM [Catalog] ORDER BY [ItemDescription];

4
Display descriptions and return item codes

In the combo box Property Sheet, set Bound Column to 1 and Column Count to 2. Set Column Widths to hide the first column and show the second, for example 0";3". Set Limit To List to Yes to require a catalog selection, and Auto Expand to Yes to match descriptions as the user types.

5
Select and save an item

Switch the parent form to Form View, open or create the appropriate stock details row, and choose an item from the combo box. Complete any other required fields, then save the record using Home > Records > Save or by moving to another record. Check the stock details table to confirm that ItemCode contains the selected code.

No separate INSERT statement is needed: For an editable bound subform, selecting the combo box value updates the current record's item-code field. Access saves that value when the record is saved; the selection does not create an additional stock details row by itself.
Free Microsoft Office alternative

Use WPS Office for Spreadsheet-Based Stock Lists and Reports

WPS Office is a free, lightweight alternative for maintaining spreadsheet-based inventory lists and preparing stock reports. Its familiar interface and Microsoft Office format compatibility make migration of spreadsheet workflows straightforward. It does not replace Microsoft Access or configure Access subforms, relationships, or bound combo boxes.

Organize item codes and descriptions in WPS Spreadsheets for simple stock-list workflows.Open, edit, and save Microsoft Excel .xlsx and .xls files.Use a familiar spreadsheet interface to filter item lists and prepare inventory summaries.Move existing Excel-based stock reports into a free, lightweight office suite.
microsoft office alternative - wps office

Frequently Asked Questions

How can the combo box show a description but save the item code?

In Design View, select the combo box and open its Property Sheet. Put ItemCode first and ItemDescription second in the Row Source, set Bound Column to 1, set Column Count to 2, and hide the first column through Column Widths. Set Control Source to the stock details ItemCode field.

Do I need SQL INSERT code when an item is selected?

Not when the combo box is bound to the item-code field in an editable subform. Access saves the selected code with the current record. A separate insert operation is only needed if your design uses unbound controls or explicitly creates another record.

Why does Access ask for a parameter when I open the item list?

Access may not be able to resolve a form, control, or field name in the Row Source. Open the combo box Property Sheet > Data > Row Source and check every name, especially Forms!frmStock!txtItemSearch. The referenced parent form must be open for that expression to work.

Why does selecting an item fail to save the code?

Open the subform in Design View and check that its Record Source is editable, Allow Edits is Yes, and Allow Additions is Yes if you are creating a new row. Check the combo box's Control Source and confirm that the catalog key and stock details foreign key have compatible data types. Also complete any other required fields before saving.

Can WPS Office run this Access subform workflow?

No. WPS Office does not run Microsoft Access forms or Access database relationships. Keep this workflow in Access; use WPS Spreadsheets for separate stock lists or reports exported to compatible formats such as .xlsx.