hello,
i'm having this problem when try to display the total amount form subform to form,for example i'm having two tables one for the products which contains(p_no,p_name,price),and the other table contains(p_no,total_price,total_amount)
so the first table is placed in subform and the other table is placed in the main form,i wanna to calculate the total (price) in subform and display the result in the (total_price) field in main form,i'm tryin to use the dsum function but it dosent't work and give me this error (#name), can any one help????????
zaiena,
the way it usually works is:
1. you have a total for the subform details in the <<footer>>> section of the subform, which should have this expression: = Sum([Price])
2. the main form total gets a copy of the subform total by means of the following expression in the main form textbox for the total:
Me!total_price.Value = Me!YourSubformControl.Form!YourSubformTotalName
3. To refresh the main form total any time the subform total changes, place the following code behind the subform (not main form):
-
Private Sub YourSubformTotal_Change()
-
Me.Parent!total_price.Recalc
-
End Sub
-
You need to replace any generic names I used above with the actual names of those objects in yor application. Let me know how it goes.