Saving calculated value into table

JiTS

Ciao!
Local time
Today, 23:48
Joined
Dec 12, 2003
Messages
77
Hi,

I want to save a calculation from a subform into a table.

Problemsituation:
I have a mainform with a subform in it. In the subform is a calculation with a result (400). This result will be showed in the text box (Verschil fust) in the main form, see attachment.

To show the result I added the following line to the controlcourse of 'Verschil fust' (mainform):

=[Forms]![frmAanvoergegevens]![fsubFustgegevens].[Form]![txtTotaalVerschilFust]

This works perfectly, but I want also to save the result (400) into field of a table.

Problem/question:
Normally is the controlcourse the fieldname of a table but not in this case.

Possible solution:
I move the line of above to the calculation textbox. That means that after the calculation is done, the calculation textbox puts the result in the mainform textbox 'Verschil fust' or in the fieldname of the table. The result will be that 'Verschil fust' shows '400' and it will be saved into the fieldname of the table.

Somebody any ideas how to do this?!? :confused:
 

Attachments

  • problemsituation.jpg
    problemsituation.jpg
    24.5 KB · Views: 121
If the expression displays the value at runtime then why would you need to store the value in a table?

Storing calculated expressions creates field dependancy on non-key fields. Do a search on normalisation, especially Third Normal Form (3NF).
 
Thanks for your advice.

I am really focused to put everything in tables but I know now that I only have to put data in the tables.

I will keep that in mind! ;)


Regards,
JiTS
 
saving calculated value into a table field

Interesting that one answer was "why would you want to save a calculated field to a table?"

Years ago we created a well designed and exceptionally functional billing system for our newspaper with dBaseII ... it still functions just fine, but the old 486 (MS DOS) machine that has been so faithful through the years is reaching its "past prime and old age condition." Anticipating a failure, and unable to transport dBaseII programs to a Windows based machine, we turned to MS Access.

One of the critical fields that we need in our customer database is one we call "Pbal" (for previous balance). This is important for a quick look at who owes how much at the end of each monthly billing cycle ... and each month when we run the billing cylce, we need the new monthly balance (calculated in a totals field on the report) to automatically replace the value in the customer database "Pbal" field.

So far, I've been unable to figure out how to go about that process. Please, don't tell me I shouldn't do it (as has everyone else who has bothered to respond in other forums) ... we do not want to manually type a couple hundred new balances every month.

Surely there's a macro or some other function to simply take the calculated field total for each customer and update the table field.

Thanks ...

Wesley W. Burnett
The Post Dispatch
Post City Television
Post City Radio

Post City, Texas
 

Users who are viewing this thread

Back
Top Bottom