calculation on form

  • Thread starter Thread starter _Bigred
  • Start date Start date
B

_Bigred

(Access 2000)

I have created my table with desired fields, then the query based on it and
then a form based on the query. Now I want to go into the form and make a
particular field (box) a formula/calcualation.

I need to do something to the effect of:

If [BasePay] is <13 then add 25¢ (up to maximum of $13.00), if greater then
12.90 then add 10¢.

I can do it in excel 2000, but how would I setup the formula/calculation in
access on this form I want to use.

TIA,
_Bigred
 
try putting this (including the = sign) as the control source for that box (remember that this will be an unbound box and the result will NOT be saved):

=IIf([BasePay]>12.9,[BasePay]+0.1,IIf([BasePay]>12.75,13,[BasePay]+0.25))

Here's the syntax of iif (which can be nested multiple times): iif(expression to test, value if true , value if false)

Here's the logic:
- if greater than 12.9, add .10 (without a cap of 13) -> [BasePay]+0.1
- if not greater than 12.9, then test if greater than 12.75 (because all values between 12.75 and 12.9 should = 13) -> IIf([BasePay]>12.75
- if greater than 12.75 then give a value of 13 (12.75 + 0.25) - remember, we already tested for greater than 12.9, so no need to test if it's < 12.9
- if less than 12.75, add 0.25 -> [BasePay]+0.25

good luck
-hai

----- _Bigred wrote: -----

(Access 2000)

I have created my table with desired fields, then the query based on it and
then a form based on the query. Now I want to go into the form and make a
particular field (box) a formula/calcualation.

I need to do something to the effect of:

If [BasePay] is <13 then add 25¢ (up to maximum of $13.00), if greater then
12.90 then add 10¢.

I can do it in excel 2000, but how would I setup the formula/calculation in
access on this form I want to use.

TIA,
_Bigred
 
Hello Hai,

That worked like a charm, I appreciate your time and assistance.

Thank You,
_Bigred


hnq51834 said:
try putting this (including the = sign) as the control source for that box
(remember that this will be an unbound box and the result will NOT be
saved):
=IIf([BasePay]>12.9,[BasePay]+0.1,IIf([BasePay]>12.75,13,[BasePay]+0.25))

Here's the syntax of iif (which can be nested multiple times):
iif(expression to test, value if true , value if false)
Here's the logic:
- if greater than 12.9, add .10 (without a cap of 13) -> [BasePay]+0.1
- if not greater than 12.9, then test if greater than 12.75 (because all
values between 12.75 and 12.9 should = 13) -> IIf([BasePay]>12.75
- if greater than 12.75 then give a value of 13 (12.75 +
25) - remember, we already tested for greater than 12.9, so no need to
test if it's < 12.9
- if less than 12.75, add 0.25 -> [BasePay]+0.25

good luck
-hai

----- _Bigred wrote: -----

(Access 2000)

I have created my table with desired fields, then the query based on it and
then a form based on the query. Now I want to go into the form and make a
particular field (box) a formula/calcualation.

I need to do something to the effect of:

If [BasePay] is <13 then add 25¢ (up to maximum of $13.00), if greater then
12.90 then add 10¢.

I can do it in excel 2000, but how would I setup the formula/calculation in
access on this form I want to use.

TIA,
_Bigred
 
Back
Top