View Single Post
  #5  
Old May 29th, 2004, 02:58 PM
Peter R. Fletcher
external usenet poster
 
Posts: n/a
Default storing calulations

As everyone has pointed out, you generally do not want to do this, and
if your design produces up with a requirement to store a calculated
result, you should review it very critically, since there is almost
always a better (more relationally sound) way of doing what you are
trying to do. However, if you are sure you want to do this, the most
straightforward way to do it is to put code into the AfterUpdate Event
of all the user-modifiable fields which contribute to the calculation
which includes a specific assignment of the calculated result to a
field in the table. A very simple-minded example:

Your form, bound to your table, has two text boxes on it (which may be
bound to fields in the table, but don't have to be) called txtA and
txtB, and you want to save the sum of the values in those two text
boxes into a field in your table called CalcValue. In the AfterUpdate
Event code for _each_ of the textboxes, you will put the line

CalcValue= txtA + txtB

It's a lot easier to do than to describe.

On Fri, 28 May 2004 04:47:39 -0700, "Steve Fama"
wrote:

How do I store calulations in a table. I have calc. in a
form, how do I store the results in a table. Please help


Please respond to the Newsgroup, so that others may benefit from the exchange.
Peter R. Fletcher


----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! 100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---