How can I assign mathematical operation between the fields?

  • Thread starter Thread starter saeid naeimi-manesh
  • Start date Start date
S

saeid naeimi-manesh

Hi:
I designed the Form in access XP version but I can't relate some fields
together. Ex: I have 18 fields as Amount1 to Amount 18 and want to put the
sum of them in the Subtotal Field, also I want to calculate the tax for
subtotal and write it in Sales Tax field, then add this two field(SubTotal &
Sales tax and put it in the Final Amount field
Please guide me to overcome this problem

Regards,
Saeid
(e-mail address removed)
 
I think this will work:

In the 'Control Source' property of the Subtotal field
(right-click the field, select 'Properties'), enter the
following:
'=[Amount1] + [Amount2] + .. + [Amount18]
(with the rest of your fields in place of '..')

In the Tax field's 'Control Source' property, enter
'=[SubTotal]*1.15'

and in the Total field's 'Control Source' property, enter
'=[SubTotal] + [Tax]'.

This should work.. as long as your fields are all numeric.

Gurtz
[email = no $]
 
Hi:
I designed the Form in access XP version but I can't relate some fields
together. Ex: I have 18 fields as Amount1 to Amount 18 and want to put the
sum of them in the Subtotal Field, also I want to calculate the tax for
subtotal and write it in Sales Tax field, then add this two field(SubTotal &
Sales tax and put it in the Final Amount field
Please guide me to overcome this problem

The problem is in your table design. You're using a relational
database; use it relationally!! Rather than having 18 *fields* in your
table, use TWO tables in a one to many relationship and add up to 18
*records*. Secondly, you should not store values such as subtotal,
sales tax, and final amount in your Table - you should calculate them
on the fly in a Query or on a Form or Report.

Stop, step back, and learn a little about relational database design
principles. You may want to consider the Northwind sample database
that comes with Access: it includes an order form which does just what
you're apparently trying to do, using normalized tables.
 
Back
Top