Getting a value from a subform to it's parent form

  • Thread starter Thread starter Arvin Meyer
  • Start date Start date
I have a subform with a calculated field that totals one of the fields
on the subform. I would like to use that total in another calulated
field on the parent form. How can I do this?

Thanks,
Robin
 
I entered

=Forms!Client_Account!Transaction_Detail.Form!Order_Total.value

in the Control source of the textbox on the parent form. The Parent
form is Client_Account, the Subform is Transaction_Detail and the
textbox on the subform is Order_Total. I'm getting an invalid syntax
error message when I try to leave the property. What am I doing wrong?

Thanks,
Robin
 
Never mind that error, it was a typo but now I get the #Name? msg in the
textbox on the form.
 
I'm not sure what you mean by the subform control. If I click on the
white box that where the subform goes on the form in design view, I'm
assuming that's what you mean) the caption of the Properties reads
"Subform/SubReport: Transaction_Detail_subform". I put
Transaction_Detail_subform in place of Transaction_Detail but I'm
getting the same result. Here is the statement as it now stands :

=[Forms]![Client_Account_2]![Transaction_Detail_subform].[Form]![Order_Total]

Do you see any problems with that statement?

Thanks,
Robin
 
Oh, it's not working, but it's not the same result. It now says #Error
instead of #Name?. Prgress maybe? :)

Robin
 
A subform does not become a form in the main form until it has focus. Until
that time it is a control, (like a textbox, combobox, etc.) and has a name
which can be the same as the form name, but often is not.

=[Forms]![Client_Account_2]![Transaction_Detail_subform].[Form]![Order_Total
]

is correct if:

Transaction_Detail_subform

is the name of the subform control. Click on the subform control and look at
it's name property (not it's source object property which is the subform
name, not the subform controlname)
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

Robin Hickman said:
I'm not sure what you mean by the subform control. If I click on the
white box that where the subform goes on the form in design view, I'm
assuming that's what you mean) the caption of the Properties reads
"Subform/SubReport: Transaction_Detail_subform". I put
Transaction_Detail_subform in place of Transaction_Detail but I'm
getting the same result. Here is the statement as it now stands :

=[Forms]![Client_Account_2]![Transaction_Detail_subform].[Form]![Order_Total
]

Do you see any problems with that statement?

Thanks,
Robin

Arvin said:
Is Transaction_Detail the name of the subform, or the name of the subform
control? It needs to be the name of the subform control. Value is the
default property of a textbox, so it doesn't need to be used.
 
Back
Top