By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,939 Members | 1,541 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,939 IT Pros & Developers. It's quick & easy.

DSum function

P: 20
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????????
Jun 21 '07 #1
Share this Question
Share on Google+
1 Reply


puppydogbuddy
Expert 100+
P: 1,923
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):
Expand|Select|Wrap|Line Numbers
  1. Private Sub YourSubformTotal_Change()
  2. Me.Parent!total_price.Recalc
  3. End Sub
  4.  
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.
Jun 21 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.