Updating records to the main form

  • Thread starter Thread starter Allie
  • Start date Start date
A

Allie

I have a main form that holds the summary of the
information in the subform. So far I have it updating the
main form when a new record is added or when it is
deleted. The problem is when a record's value is
changed. For example: the current value of price is
$9.99, it needs to be changed to $10.00. If I change the
value - the total price on the main form will become
$19.99 instead of $10.00.

Any suggestions?

Thanks
 
Hi Allie

Is the textbox on your main form showing the sum of all the values on the
subform? If so, then you should not *store* that value anywhere, but just
let the form calculate it and display it.

Put a textbox in either the header or footer of the subform. Set its
properties as follows:
Name: txtTotalPrice
ControlSource: =Sum([Name of Price Field])
Visible: No

Now, set the controlsource of the textbox on your main form to:
=[Name of subform control].Form![txtTotalPrice]

Job done.
 
Back
Top