How to Reference Access Subform Controls in an Update Query
Question details
The user needs to use values from a subform's controls as criteria in an MS Access update query to adjust available inventory.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Updating an inventory database where entering a reservation on a subform should trigger an update query to automatically reduce the available capacity by one.
- Observed behavior
- The update query fails to recognize the controls on the subform, causing Access to incorrectly prompt the user for parameter values or update unrelated records.
Verify the exact names of your main form, the subform control on your main form (which can differ from the subform's actual object name), and the specific fields you want to reference.
Use the Fully Qualified Form and Subform Control Reference
The most common reason for parameter prompts is an incorrect reference path. You must specify the full, fully-qualified path through the main form to the subform control.
Microsoft Access requires a very specific syntax to locate a control inside a subform. If you omit the '.Form' property or reference the wrong container, the query engine treats the criteria as an unknown parameter.
Right-click your update query in the navigation pane and select 'Design View'.
Navigate to the column of the field you want to filter (for example, 'SailDate' or 'Product').
In the Criteria row, enter the syntax exactly as follows: [Forms]![MainFormName]![SubformControlName].[Form]![ControlName]
Replace the placeholders with your actual names. For example: [Forms]![MainForm]![SubformControl].[Form]![SailDate].
Save the query, ensure your main form is open and populated with data, and run the update query to verify it executes without prompting for parameters.

Calculate Availability Dynamically Using Related Tables
Instead of running an update query to manually reduce a static 'Available' number, restructure your database to calculate capacity on the fly.
Simplify Inventory Management with WPS Office
While Microsoft Access requires complex queries, VBA, and precise control referencing for inventory management, many users find that spreadsheet-based systems are far more intuitive. WPS Office offers a powerful, free alternative to Microsoft Office that easily handles inventory and reservations using straightforward spreadsheet formulas.
- 1. Install WPS Office: Download and install the free suite to access WPS Spreadsheet on your device.
- 2. Set Up Your Inventory Tracker: Create a new spreadsheet and list your capacities, sailing dates, and incoming reservations.
- 3. Automate Calculations: Use built-in formulas to subtract booked reservations from your total capacity dynamically without writing any macros.

Frequently Asked Questions
Why does my Access update query ask for parameters when triggered from a subform?
This usually happens because the query cannot find the control you referenced. It occurs if the main form is currently closed, if the control name is misspelled, or if the reference syntax is incorrect (such as forgetting the '.Form' property in the subform path).
What is the difference between an Access subform and a subform control?
The subform is the actual form object saved in your database navigation pane. The subform control is the 'box' container on your main form that displays the subform. References in queries must use the name of the subform control container, not necessarily the subform object itself.
Can I use VBA instead of a macro to run an update query based on subform data?
Yes, using VBA commands like DoCmd.RunSQL or CurrentDb.Execute gives you much more control over the update process. Using VBA allows you to build the SQL string dynamically, directly inserting the form's control values into the SQL statement rather than relying on parameter references.




