Calculations In A Form

G

Guest

I am an admitted novice and need some help in getting my form to do what I
want in relation to the table.

I have a field labeled "5% Option" What I want this field to do is
calculate 5% of another field labeled "Total Cost". I have done this in the
control source of the former but it does not update when I enter the "Total
Cost" figure. I have to proceed to the next record and go back before i can
see the update.

Furthermore what I really want to do with the "5% Option" is this:

"If [Total Cost] is greater than $350.00, then multiply that figure *.05 If
Not Don't Calculate This Field and leave at 0" And I would like it to update
as the person enters a figure in the "Total Cost" Can anyone help me with an
expression for this and where to put said expression? These self-help books
are killing me with vagueness.

I really appreciate someones help.
 
G

Guest

Put this in the "after update" event of your [total cost] field

if [total cost] > 350 then 5%option = [total cost]*1.05
else if [total cost]<= 350 then 5%option = 0
end if

I think that might work though I am not too confident with my "End If's"
 
A

Al Campagna

Scuba,
The 5PctOption, as a general rule, should not be a "bound" field. As
long as we capture [TotalCost], we can always calculate 5% of TotalCost "on
the fly" in any form, query or report... as an unbound calculation.
An Example...
Price * Qty = Line Total
we would not save the Line Total.
calculate 5% of another field labeled "Total Cost".
That would be [TotalCost] * .05

([TotalCost] * 1.05 is actually 105% of [TotalCost])
--
hth
Al Campagna
Access MVP 2007
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love, and you'll never work a day in your life."


scubadiver said:
Put this in the "after update" event of your [total cost] field

if [total cost] > 350 then 5%option = [total cost]*1.05
else if [total cost]<= 350 then 5%option = 0
end if

I think that might work though I am not too confident with my "End If's"

--

The 11th day of every month:

http://truthaction.org/forum/index.php


Stefan said:
I am an admitted novice and need some help in getting my form to do what
I
want in relation to the table.

I have a field labeled "5% Option" What I want this field to do is
calculate 5% of another field labeled "Total Cost". I have done this in
the
control source of the former but it does not update when I enter the
"Total
Cost" figure. I have to proceed to the next record and go back before i
can
see the update.

Furthermore what I really want to do with the "5% Option" is this:

"If [Total Cost] is greater than $350.00, then multiply that figure *.05
If
Not Don't Calculate This Field and leave at 0" And I would like it to
update
as the person enters a figure in the "Total Cost" Can anyone help me
with an
expression for this and where to put said expression? These self-help
books
are killing me with vagueness.

I really appreciate someones help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top