add a textbox called say txtSum to the subform footer with =sum(calculation) as the controlsource where calculation is however you are calculating the value (e..g =sum([quantity]*[price])
on the mainform, you reference it with =salesdetails.form.txtSum