Updating Info

G

Guest

This probably sounds fairly simple, but I can't get all aspects of this to
work. I have 4 text boxes.
1. Part Cost - in Dollars
2. Part Quantitiy - Number
3. Total Part Cost - in Dollars, needs to equal Part Cost * Part Quantity
4. Total of all parts cost, Total of all Part dollars on form
Number 1,2 and 3 are tied to a table the user is entering this data into the
text box as additions to the table. Number 4 has a formula for the data
control source.
The problem I am having is updating number 3 and 4 whenever number 1 and 2
are changed. I have come up with different ideas in my Visual Basic to try to
do calcs 'OnChange', etc but I can't get a bullet proof way.
Thanks for the help!
 
C

Carl Rapson

sturner333 said:
This probably sounds fairly simple, but I can't get all aspects of this to
work. I have 4 text boxes.
1. Part Cost - in Dollars
2. Part Quantitiy - Number
3. Total Part Cost - in Dollars, needs to equal Part Cost * Part Quantity
4. Total of all parts cost, Total of all Part dollars on form
Number 1,2 and 3 are tied to a table the user is entering this data into
the
text box as additions to the table. Number 4 has a formula for the data
control source.
The problem I am having is updating number 3 and 4 whenever number 1 and 2
are changed. I have come up with different ideas in my Visual Basic to try
to
do calcs 'OnChange', etc but I can't get a bullet proof way.
Thanks for the help!

You could try the AfterUpdate events of text boxes 1 and 2. Note: there
should be no need to store the total part cost, because you can easily
regenerate it at any time (in a query, for example) from the cost and
quantity.

Carl Rapson
 
G

Guest

Ah ha!

You have provided the classic reason of why you should NEVER store
calculations in a table.

Always use a query.
 
G

Guest

Having said that...

What you can do is base the form on a select query so the calculations
appear in disabled, read only text boxes. :)

Then the calculations will update every time box 1 and 2 changes.
 

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