A couple of points here:
(a) You say When I add calculated fields to the underlying query, it becomes non-updatable. This should not be the case. For example:
[tt]
SELECT Num1, Num2, Num1+Num2 AS YourTotal
FROM tblYourTable;
[/tt]
still allows fields Num1 and Num2 to be updated in the query (directly or through a form). Thus for horisontal totalling, this technique is legitimate.
(b) For vertical totalling in a subform, add a Form Header / Footer to the subform, and in the footer part, add an unbound control for each field you want to total on the subform; Lets assume that you were using the query provided above as the recordsource to the subform, and you wanted to vertically total the Num1 and Num2 columns. You would create two unbound controls in the footer section, name them SumSum1 and SumNum2 respectively, and set their respective ControlSource properties to:
[tt]
=Sum(Num1)
and
=Sum(Num2)
[/tt]
respectively. Make sure you include the equal signs, and dont include any quotes.
(c) If you are displaying the subform in Continuous Form mode, then the Report Footer (and the above total fields) will be visible as part of the subform display in the main form. If you are displaying the subform in datasheet view, then the report footer will not be visible (shock horror). Fear not though, the Access engine has still done its job, and the computed SumNum1 and SumNum2 control values are still available. Simply place some additional controls on the MAIN form, and set them to the appropriate subform controls; eg. if the subform control is called YourSubForm, then, set the respective main form controlsource properties to:
[tt]
=YourSubForm!SumNum1
and
=YourSubForm!SumNum2
[/tt]
The values will propogate back to the main form, and will be fully dynamic. As you add/change delete records in the subform, the subtotals will remain accurate.
(d) For the subtotal controls discussed above, you might want to set the Enabled and Locked properties appropriately so that the user cannot attempt to move to or change them.
Hope this Helps,
Steve Lewy
Solutions Developer
steve@lewycomputing.com.au
(dont cut corners or you'll go round in circles)