Insert an Item Code into a Microsoft Access Subform Using a Combo Box
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.
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.
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.
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.
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.
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];
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.
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.
Filter the subform combo box using a description search box
Add this optional filter when users need to find descriptions containing a search term rather than matching only the beginning of a description.
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.

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.




