Percentage Calculated field

louisa

Registered User.
Local time
Today, 22:05
Joined
Jan 27, 2010
Messages
262
Hi Everyone,

I am adding a new form to my database which will have a field called "percentage back" there will also be a field called "monthly costs" once a figure has been entered into the field "monthly costs" i would like it to work out the percentage figure and put that into a "total field" for example:

£2850.00 is entered into "monthly costs" and in the "percentage back" field is 10% so in the total field should be £285.00.

The only problem is it might not always be 10% it could be 5%, 7% etc, does anybody no how i can do this?

Many thanks
 
What is the problem here ??
If it is 10%, write 10% in the "Percentage back" field.
if it is 5%, write 5%, and s.o.
 
If you are storing the value in field formatted as Percentage, you can simply use the following in the Control Source of an unbound text box;
Code:
=Me.[monthly costs]*Me.[percentage back]

If you are simply storing percentage back as an integer, you can use;
Code:
=Me.[monthly costs]*Me.[percentage back]/100
 
The problem is i want it to work out the percentage back value and place in the total box but am unsure as to the formula as the percentage will always differ.
 
OK then;
Code:
[percentage back] = ([Rebate Amount]*100)/[monthly costs]
This will return the percentage used to calculate the rebate.
 
Hi All,

I still cannot get this to work :-( if i explain by example:

I have on my form 3 fields all next to each other, one is called "call spend" then "percentage" then "amount due"

If i enter £2850 in to call spend and 10% in to percentage i want it to work out the 10% of £2850 which will be £285 and that figure to then be displayed in amount due.

However it may not always be 10% could be 7 etc. I am not sure if i am putting the code in the wrong place but either way i cannot get in to work.
 
To work out the value you need 2 things

The Numerator and the Denominator

The Denominator is the total value which is 100% ie 2580
The numerator is the percentage you want to apply ie 5%, 7%, 10%, etc

To work out the value of the percentage as a value

Me.TxtRebate = (Me.TxtDenominator / 100 ) * Me.TxtNumerator

Thus

n = (2580/100) * 7

n = 108.6
 
Hi All,

I still cannot get this to work :-( if i explain by example:

I have on my form 3 fields all next to each other, one is called "call spend" then "percentage" then "amount due"

If i enter £2850 in to call spend and 10% in to percentage i want it to work out the 10% of £2850 which will be £285 and that figure to then be displayed in amount due.

However it may not always be 10% could be 7 etc. I am not sure if i am putting the code in the wrong place but either way i cannot get in to work.

That's what my solution in post number 3 does. Doesn't it :confused:
 
Hi John,

I have tried what you advised in post number 3 but my "AmountDue" field displays #Name? and doesnt work it out, i am placing the code in the control source of the AmountDue field.
 
Look at "DemoPercentageA2002.mdb" (attachment, zip).
Open Form1 and try. Look at VBA.
 

Attachments

Hi John,

I have tried what you advised in post number 3 but my "AmountDue" field displays #Name? and doesnt work it out, i am placing the code in the control source of the AmountDue field.

Did you change the control names to match those on your form?
 
Thanks for all your help everyone i now have it working with one slight problem.
My form is a tabular so the end value is duplicating on all records which i dont want???
 
it may be that you ar using a continuious form????
 
Hello, it was set to continuous but all the other fields do not duplicate across them all but that one field does?
 
OK, if your form is "Continuous", there is 2 ways.
1) Make the form via Query. Look at Query1, Form2.
Open Form2 and try.
2) You can link the AmountDate field with the same
field in the table. In that case you don't need a query.
Look at attachment (zip).
Open Form2 and try.
 

Attachments

Hi MStef

I have opened your Form2 and that is exactly what i want however i cannot work out how you have achieved this. I would prefer not to use a Query.
 
MStef

I have done it, thank you so much for all your help and patience.
 

Users who are viewing this thread

Back
Top Bottom