In your Subform:
Create a text box called 'txtsfrmTotal' in the footer section of the sub form
(Note: Because you are displaying the sub form as a datasheet this new field will not be displayed on screen but you can still refrence it)
In the data controlsource of the new textbox 'txtsfrmTotal' enter
=Sum([unitprice]*[quantity])
Note:You need to SUM the [unitprice]* [quantity] to arrive at the sum field you cannot simply do a SUM of the calculated line field totals.
On the MAIN FORM create a textbox called
'txtOrderTotal'
in the data controlsource for this text box enter
=[sfrmDetails].[Form]![txtSfrmTotal]
Note: In this example the subform in called 'sfrmDetails' you will have to substitute the name of the sub form you are using.
Also note how the 'txtOrdertotal' is only updated when you move to another record.
An example of how to do this can be found in the 'Northwind Database' in the ORDERS Form
Also, as Jack Cowley has pointed out, more info can be obtained from the Knowledge base article Jack has refered to
Hope this helps
Trevor from Accesswatch.co.uk