iain dickinson
01-30-2001, 12:41 AM
I created a form to input all my data into. In the form their are several fields containing calculations which rely on values from other fields. However when I go back into the original table these calculations don't appear and only null values are their. Can someone please help.
Chris RR
01-30-2001, 06:34 AM
Hope this helps: Your data is stored in tables. Forms don't store any data, ever, but they can help you get your data into tables.
The fields in tables store values, not calculations. You can use a form to store the results of a calculation into a field in a table.
novabill
02-01-2001, 05:56 AM
I hope I can explain this easy. I ran into this same problem also. In order to store calculated fields finished data into a table you will need to create several things. 1st you will need to create a new lable on the form that has the calculated field (mark this field as not visible, you don't need to see it on your actual form as it is simply a transport spot for your calculated data to get to your table). Link the label to the field in your table that you want to contain the output data from your calculation in. Now you need to create a new macro that will put the output data into the field in your table. Now for example lets say your calculated field is called Total Dollars1. The new label you create can be titled anything you want but you need to make its control source your datas destination field in your table. So lets say that your field in your table is called Total Dollars. Now you are ready to create your new macro. All you need is one action in the macro. This action will be a "set value". In the Item line you will need to put in [Forms]![the name of your form]![the name of your field in the table that you want your data to go to] This is how it would look (I am using "Price" as the name of your form in this example). [Forms]![Price]![Total Dollars] Now the next line called Expression would be [Forms]![Price]![Total Dollars1] Now the only thing left to do is tell this new macro when to run. Do this in your Form properties, on the event tab, add your new macros name on the line called "before update". I hope that this works for you and this is for Access 97.
Storing calculated fields in a table is not recommended especially when using a macro which has no error handling , put the calculated fields into a query and base the form on that.