Welcome to the Excel Forum

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.

Please Register to Remove these Ads

Please Register to Remove these Ads



Reply
  #1  
Old 06-16-2009, 05:37 AM
wrightie wrightie is offline
Registered User
 
Join Date: 21 Aug 2008
Location: Gibraltar
MS Office Version:Excel 2007
Posts: 46
wrightie is becoming part of the community
Calculate a field in a Report

Please Register to Remove these Ads

Hi,

This is driving me insane. Hoping someone can save me !

I have a report and within the report I have some calcualtions in some textboxes.
What I want to know is can I calculate this field that has
=[PremBal]*[Comm]/100 in the control source.

Any help is much appreciated.

Wrightie

Last edited by wrightie; 06-17-2009 at 09:26 AM.
Reply With Quote
  #2  
Old 06-16-2009, 09:23 AM
split_atom18 split_atom18 is offline
Forum Contributor
 
Join Date: 23 Apr 2009
Location: Fredericksburg, IA
MS Office Version:Ultimate 2007
Posts: 126
split_atom18 Has established their mark in the community
Re: Calculate a field in a Report

I am not sure I am totally following you. You can do all kinda of calculations, however on a report sometimes you need to do them and either have vba replace the data in the "control source field" or you can have vba calculate and replace the data.

Without knowing more, not sure how else I can help.

Dan
__________________
"I am not a rocket scientist, I am a nuclear engineer." - Split_atom18
If my advice has been helpful to you, then please help me by clicking on the scales and adding to my reputation, Thanks!
Reply With Quote
  #3  
Old 06-16-2009, 11:00 AM
wrightie wrightie is offline
Registered User
 
Join Date: 21 Aug 2008
Location: Gibraltar
MS Office Version:Excel 2007
Posts: 46
wrightie is becoming part of the community
Re: Calculate a field in a Report

Hi Dan,

Sorry for being vague !

What I have is 3 fields PremA, PremB & PremC which all have amounts in them. I have then created a textbox [PremBal] to sum these fields Control Source: =[PremA]+[PremB]+[PremC]
That all works fine

I also have a Comm field in my table which is a percentage (this varies but lets say for this one it's 10%) so what I've done is added another text field called CommBal and put this in
Control source: =[PremBal]*[Commission]/100
That all works fine.

So it looks like this
Premium Comm
500.00
500.00
200.00
1200.00 120.00

Now I need to sum these fields in my footer the PremA B & C works fine using
Control Source: =Sum([PremA]+[PremB]+[PremC])

This breaks per premium.

But I just can't get the CommBal field to sum i've tried these
=Sum([PremA]+[PremB]+[PremC])*[Comm]/100
=Sum([CommBal])

Arrgh it's driving me mad
Reply With Quote
  #4  
Old 06-16-2009, 02:24 PM
split_atom18 split_atom18 is offline
Forum Contributor
 
Join Date: 23 Apr 2009
Location: Fredericksburg, IA
MS Office Version:Ultimate 2007
Posts: 126
split_atom18 Has established their mark in the community
Re: Calculate a field in a Report

I have seen you refer to the "commission" field above in 2 different ways. comm and commission. Is it possible they are getting mixed up?

Also if I am understanding this correct for each record there is a possibility of 3 different premiums, do they each have their own commission? or is there only one commission percentage per record.
__________________
"I am not a rocket scientist, I am a nuclear engineer." - Split_atom18
If my advice has been helpful to you, then please help me by clicking on the scales and adding to my reputation, Thanks!
Reply With Quote
  #5  
Old 06-16-2009, 02:38 PM
wrightie wrightie is offline
Registered User
 
Join Date: 21 Aug 2008
Location: Gibraltar
MS Office Version:Excel 2007
Posts: 46
wrightie is becoming part of the community
Re: Calculate a field in a Report

Hi,

No the commission field is fine, i've just made a typo in my previous response.

Yeh each record has three different premium amounts and has only one commission percentage per record.

I hope that makes it a bit clearer for you.

Thanks again
Reply With Quote
  #6  
Old 06-16-2009, 03:09 PM
split_atom18 split_atom18 is offline
Forum Contributor
 
Join Date: 23 Apr 2009
Location: Fredericksburg, IA
MS Office Version:Ultimate 2007
Posts: 126
split_atom18 Has established their mark in the community
Re: Calculate a field in a Report

Try:

=([PremA]+[PremB]+[PremC])*[Comm]/100

or whatever your comm field is

You were doubling up Sum(field + field)

Also if you have an example file you can zip and upload that would help.

Hope this helps,

Dan
__________________
"I am not a rocket scientist, I am a nuclear engineer." - Split_atom18
If my advice has been helpful to you, then please help me by clicking on the scales and adding to my reputation, Thanks!
Reply With Quote
  #7  
Old 06-17-2009, 05:53 AM
wrightie wrightie is offline
Registered User
 
Join Date: 21 Aug 2008
Location: Gibraltar
MS Office Version:Excel 2007
Posts: 46
wrightie is becoming part of the community
Re: Calculate a field in a Report

Hi Dan,

I've attached an example for you.

Cheers
Attached Files
File Type: zip Example.zip (817.4 KB, 5 views)
Reply With Quote
  #8  
Old 06-17-2009, 09:05 AM
bhill bhill is offline
Registered User
 
Join Date: 20 Mar 2008
Location: Buffalo, NY USA
Posts: 41
bhill is becoming part of the community
Re: Calculate a field in a Report

Here is your sample modified. There were two small issues that I noticed. First, the final formula referenced calculated textbox names. You have to use the formula that's within those in your final formula - keep in mind, calculations refelct field names from your recordset, not textboxes, so Access will get confused if you try to calculate on a calculated textbox. Secondly, you just needed to sum those up - the formula as it stood only looked at the last record on each page --- =Sum(some_calculations).

Brent
Attached Files
File Type: zip Example.zip (32.2 KB, 13 views)
Reply With Quote
  #9  
Old 06-17-2009, 09:25 AM
wrightie wrightie is offline
Registered User
 
Join Date: 21 Aug 2008
Location: Gibraltar
MS Office Version:Excel 2007
Posts: 46
wrightie is becoming part of the community
Re: Calculate a field in a Report

Oh my god, thank you so much Brent.

You've made my day. What a fool I am.
Reply With Quote
  #10  
Old 06-17-2009, 12:17 PM
split_atom18 split_atom18 is offline
Forum Contributor
 
Join Date: 23 Apr 2009
Location: Fredericksburg, IA
MS Office Version:Ultimate 2007
Posts: 126
split_atom18 Has established their mark in the community
Re: Calculate a field in a Report

Bhill beat me, I finally got a chance to look at it. I do however have a question for you. Why do you have your commission % in 2750 for example then divide by 100 later?
__________________
"I am not a rocket scientist, I am a nuclear engineer." - Split_atom18
If my advice has been helpful to you, then please help me by clicking on the scales and adding to my reputation, Thanks!
Reply With Quote
  #11  
Old 06-17-2009, 12:45 PM
bhill bhill is offline
Registered User
 
Join Date: 20 Mar 2008
Location: Buffalo, NY USA
Posts: 41
bhill is becoming part of the community
Re: Calculate a field in a Report

Sorry if you wasted your time, Dan. I think my day starts an hour earlier than yours!
Reply With Quote
  #12  
Old 06-17-2009, 12:53 PM
split_atom18 split_atom18 is offline
Forum Contributor
 
Join Date: 23 Apr 2009
Location: Fredericksburg, IA
MS Office Version:Ultimate 2007
Posts: 126
split_atom18 Has established their mark in the community
Re: Calculate a field in a Report

Na, is all good, didn't take but a second after I opened it up. No worries!
__________________
"I am not a rocket scientist, I am a nuclear engineer." - Split_atom18
If my advice has been helpful to you, then please help me by clicking on the scales and adding to my reputation, Thanks!
Reply With Quote


Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 Off
Refbacks are Off

Forum Jump