How can I assign mathematical operation between the fields?

  • Thread starter saeid naeimi-manesh
  • 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)
 
G

Gurtz

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 $]
 
J

John Vinson

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.
 

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