calculated value in subform as data input in main form???

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do you use the calculated value in a subform control as data input into a
field in the underlying table of the main form?

John
 
John,
First, you shouldn't be saving the calculated value to the table behind
the main form...since you always have the the subform calculation. As long
as you save the items that led to the calculation in the subform, don't save
it again in another table.

If you want to display the calculated subform value (ex. TotalPrice),
then place an unbound calculated text control on the main form with this as
the ControlSource... (use your own control names)
= Forms!frmMainForm!frmSubForm.Form!TotalPrice
If this were a bound field, you'd have to save the calculated value every
time TotalPrice changed.

If you MUST save the calculated value to a field, you'll have to add the
following code to the AfterUpdate event of any element that effects the
value of TotalPrice in the subform...
Forms!frmMainForm!MainTotalPrice =
Forms!frmMainForm!frmSubForm.Form!TotalPrice
 
Back
Top