Pass a Value Between Microsoft Access Subforms Using the Form Property
Question details
The user needs to pass a control value from one subform to another on the same Microsoft Access main form.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Two subforms are displayed on one main form, and an action in the source subform should update a control in the destination subform.
- Observed behavior
- Referencing a control inside a subform directly may cause an object or property error; the subform control's Form property provides access to its controls.
Open the main form in Design View and check the destination subform control's Name in its Property Sheet; it may differ from the form object name. Also identify the source and destination control names and make sure the destination control is editable.
Use the Form Property to Set a Value in the Destination Subform
Use this method when both subforms are open on the main form and you want to update a control on the destination subform's current record.
Open the source subform in Design View, select the source control, and choose Property Sheet > Event > On Dbl Click. Select [Event Procedure], then click the ellipsis button to open the VBA editor.
Inside the generated double-click event procedure, add: Forms!MainFormName!subform1Control.Form!targetControl = Me!sourceControl. Replace MainFormName with the open main form's name, subform1Control with the destination subform control's Name, and the control names with your actual names.
Save the form, open the main form in Form View, and double-click the source control. Check that the destination control displays the value on its current record.

Work With Exported Access Data in WPS Office
WPS Office is a free, lightweight alternative for working with exported data and documents in a familiar interface. Export Access data to an Excel file to continue working with it in WPS Spreadsheets; WPS does not replace Access subforms or VBA database functionality.

Frequently Asked Questions
Why do I need the Form property in a subform reference?
The subform control is a container on the main form. Use its Form property to reach the form it displays and then reference a control, as in Forms!MainFormName!subform1Control.Form!targetControl.
How do I find the subform control name?
Open the main form in Design View, select the subform container, and check Name on its Property Sheet. Use that name in the reference, even if it differs from the name of the form displayed inside it.
Which destination record does the assignment change?
The assignment changes the control on the destination subform's current record. If the control is bound, Access applies the destination form's edit and validation rules when the record is saved.
When should I use an UPDATE query instead?
Use an UPDATE query when you need to update a specific table record rather than assign a value to the destination form's current control. Include criteria that identify the intended record, run the query, and requery the destination subform to display the updated data.




