 |
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|

September 16th, 2005, 09:36 AM
|
Friend of Wrox
|
|
Join Date: Sep 2005
Posts: 106
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Dividing Subtotals on a Report
Iâm having trouble dividing subtotals within a report to give me the correct percentage. Could someone help me understand why Iâm not about to or just an example of the formula should look like. Thanks
|

September 16th, 2005, 09:39 AM
|
Friend of Wrox
|
|
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
|
|
What formula are you using? What type of control?
mmcdonal
|

September 16th, 2005, 11:08 AM
|
Friend of Wrox
|
|
Join Date: Sep 2005
Posts: 106
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Iâm trying to get the percentage for the gross margent using the âretail - cost / retail.Formula looks like this GM:([p_ctrl_retail]-[P_Ctrl_cost])/[p_ctrl_retail] which works great in the Detail area, but having problems using this formula in the footers of the report. Any Idea's?
|

September 16th, 2005, 11:19 AM
|
Friend of Wrox
|
|
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
|
|
It seems to me that you would have to carry the totals down to the footers, like this:
TextBox1: =Sum([p_ctrl_retail])
TextBox2: =Sum([p_ctrl_cost])
If you didn't want the user to see these, then make them invisible.
Then do this:
TextBox3: =Sum([TextBox1]-[TextBox2])/[TextBox1])
HTH (hope it works, too.
mmcdonal
|

September 16th, 2005, 11:44 AM
|
Friend of Wrox
|
|
Join Date: Sep 2005
Posts: 106
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
That very similar to the way I have it. Question! Because I'm not looking to get a sum but a percentage for textbox3, would I need to add something different?
|

September 16th, 2005, 11:59 AM
|
Friend of Wrox
|
|
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
|
|
Open the text box's properties dialog box, select the General tab, and then change the format to percentage. See if that helps.
mmcdonal
|

September 16th, 2005, 12:19 PM
|
Friend of Wrox
|
|
Join Date: Sep 2005
Posts: 106
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
The Propertiies box is set to percentage?
|

September 27th, 2005, 11:34 AM
|
Authorized User
|
|
Join Date: Aug 2005
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Did you resolve the problem yet?
I was just curious to know.
Dharmesh Bhavsar
|

September 27th, 2005, 02:29 PM
|
Friend of Wrox
|
|
Join Date: Sep 2005
Posts: 106
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
No I havenât yet. The VBA you provide was over my head
|

September 30th, 2005, 10:05 AM
|
Authorized User
|
|
Join Date: Aug 2005
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I'm sorry, but its hard to keep up with these forums.However, I actually have reports where I had to calculate the % of sum totals and the way I did it is basically I had to create a label and put formula that calculates sum. :(Sum([p_ctrl_retail])-Sum([P_Ctrl_cost]))/Sum([p_ctrl_retail]).
see if this works or let me know with more details on the issue.
Dharmesh Bhavsar
|
|
 |