Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 16th, 2005, 09:36 AM
Friend of Wrox
 
Join Date: Sep 2005
Location: , , USA.
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

Reply With Quote
  #2 (permalink)  
Old September 16th, 2005, 09:39 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

What formula are you using? What type of control?

mmcdonal
Reply With Quote
  #3 (permalink)  
Old September 16th, 2005, 11:08 AM
Friend of Wrox
 
Join Date: Sep 2005
Location: , , USA.
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?

Reply With Quote
  #4 (permalink)  
Old September 16th, 2005, 11:19 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
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
Reply With Quote
  #5 (permalink)  
Old September 16th, 2005, 11:44 AM
Friend of Wrox
 
Join Date: Sep 2005
Location: , , USA.
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?

Reply With Quote
  #6 (permalink)  
Old September 16th, 2005, 11:59 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
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
Reply With Quote
  #7 (permalink)  
Old September 16th, 2005, 12:19 PM
Friend of Wrox
 
Join Date: Sep 2005
Location: , , USA.
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?

Reply With Quote
  #8 (permalink)  
Old September 27th, 2005, 11:34 AM
Authorized User
 
Join Date: Aug 2005
Location: , , USA.
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
Reply With Quote
  #9 (permalink)  
Old September 27th, 2005, 02:29 PM
Friend of Wrox
 
Join Date: Sep 2005
Location: , , USA.
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
Reply With Quote
  #10 (permalink)  
Old September 30th, 2005, 10:05 AM
Authorized User
 
Join Date: Aug 2005
Location: , , USA.
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 09:13 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.