Copy a Calculated Value Between Microsoft Access Forms
Question details
Display a value calculated in a text box on one Microsoft Access form on another form.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- The user calculates protein calories on the My Profile form and wants to show the result on Today's Report.
- Observed behavior
- A reference using the Value property briefly displays the result, then changes to a #Name? error.
In Access Design View, open the Property Sheet and check the Name properties of the source form and calculated text box. Confirm that the source form displays the calculated value before you open the destination form.
Reference the calculated text box from the destination form
Use a direct control reference when My Profile will remain open while Today's Report is displayed.
In the Navigation Pane, right-click Today's Report and select Design View.
Select the destination text box, open its Property Sheet, and on the Data tab set Control Source to =[Forms]![My Profile]![txtProteinCalories].
Open My Profile and then Today's Report in Form View. If #Name? appears, check that the names in the expression match the source form and text box Name properties.
Pass the calculated value with OpenArgs
Use OpenArgs to pass the current value as Today's Report opens, without relying on the source form remaining open.
Use WPS Office for Spreadsheet-Based Calculations
WPS Office is a free, lightweight alternative with a familiar interface for documents and spreadsheets. Open compatible Office files to move everyday work into WPS; Access forms and OpenArgs still require Microsoft Access.

Frequently Asked Questions
Why does my Access text box show #Name?
Access may not recognize a form or control name in the expression. In Design View, check each object's Name property and confirm that the source form is open.
Where do I enter the OpenArgs code?
Put DoCmd.OpenForm in the opening button's On Click event procedure on My Profile. Put the assignment in Today's Report's On Load event procedure, using Code Builder for each.
Can I close the source form after passing the value?
Yes. OpenArgs passes the current value when the destination form opens, so the source form does not need to stay open afterward. A direct Forms reference does require it to remain open.
What is the difference between a text box and a control?
A control is an object on an Access form, such as a text box, button, or label. A text box is a type of control that can display or accept a value.
Will OpenArgs update the destination if the source value changes later?
No. OpenArgs passes the value when the destination form opens. Use a direct control reference while the source form remains open if the displayed value needs to follow the source.




