Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
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
 
Old September 16th, 2005, 09:36 AM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 106
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Corey
Default 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

 
Old September 16th, 2005, 09:39 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

What formula are you using? What type of control?

mmcdonal
 
Old September 16th, 2005, 11:08 AM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 106
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Corey
Default

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?

 
Old September 16th, 2005, 11:19 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

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
 
Old September 16th, 2005, 11:44 AM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 106
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Corey
Default

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?

 
Old September 16th, 2005, 11:59 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Open the text box's properties dialog box, select the General tab, and then change the format to percentage. See if that helps.


mmcdonal
 
Old September 16th, 2005, 12:19 PM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 106
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Corey
Default

The Propertiies box is set to percentage?

 
Old September 27th, 2005, 11:34 AM
Authorized User
 
Join Date: Aug 2005
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Dharam80
Default

Did you resolve the problem yet?
I was just curious to know.

Dharmesh Bhavsar
 
Old September 27th, 2005, 02:29 PM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 106
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Corey
Default

No I haven’t yet. The VBA you provide was over my head
 
Old September 30th, 2005, 10:05 AM
Authorized User
 
Join Date: Aug 2005
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Dharam80
Default

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





Similar Threads
Thread Thread Starter Forum Replies Last Post
Dividing Two Running Sums in a Report Odeh Naber Access VBA 11 November 7th, 2008 03:45 PM
Subtotals bab02 Excel VBA 0 May 21st, 2007 05:56 PM
Dividing a text into 2 Columns in XSL-FO NEO1976 XSLT 0 September 19th, 2006 04:31 AM
Subtotals in access report using vba bogaerts Pro Visual Basic 2005 0 January 30th, 2006 08:33 AM
Dividing contents of 1 excel file into many Wire Excel VBA 1 April 12th, 2004 05:44 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.