Retrieve a Hidden Bound Column Value in Microsoft Access
Question details
Retrieve a hidden value from a query result and use it in another form control.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- A user wants to select a query record and transfer its hidden bound column value to a form control.
- Observed behavior
- The query is displayed in datasheet mode, which does not normally provide the record-selection event needed for the transfer.
Identify the query column containing the value and the destination field or control. If you want to save the value to a field, make sure the form's record source is editable and the field accepts the value's data type.
Use a List Box to Store the Hidden Bound Value
Use this approach when selecting a list item should write its hidden value directly to a field on the form.
Open the form in Design View, add a List Box, and open its Property Sheet.
On the Data tab, set Row Source to the query. Include both the value to store and a descriptive column users can see.
Set Bound Column to the position of the value column. On the Format tab, set Column Count and Column Widths so the value column has a width of 0 and the descriptive column remains visible.
On the Data tab, set Control Source to the form field that should receive the selected value. If needed, bind a separate text box to the same field for display.
Switch to Form View, select an item in the list box, and save the record. Check that the destination field contains the hidden bound value.

Copy the Selected Value with a SetValue Macro
Use a control event and a macro when the selected value needs to be copied to another control.
Work with Office Files in WPS Office
WPS Office is a free, lightweight alternative for everyday document, spreadsheet, and presentation work. Its familiar interface and Microsoft Office format compatibility make it easy to move common files, although it does not fix Microsoft Access form or database issues.

Frequently Asked Questions
Can a list box store a value from a hidden column?
Yes. Set the list box's Bound Column to the value column, then set that column's width to 0 in the Column Widths property. Bind the list box's Control Source to the field where the value should be stored.
Which event should run a macro after a list selection?
Use the list box or combo box's After Update event. In Design View, open the control's Property Sheet, select the Event tab, and create a macro for After Update.
Why use a form instead of opening the query directly?
A form provides events and controls that can respond to user actions. A query opened directly in datasheet mode does not normally provide the record-selection event needed to copy the value.
Will the copied value be saved automatically?
The target must be bound to an editable field for the value to be stored in the record. Save the record after selecting a value; an unbound control only displays it.




