Data from Forms won't go into Table

Shooting Star

Registered User.
Local time
Today, 10:23
Joined
Dec 22, 2008
Messages
15
Hi,

I'm rather new to databases to start off with and am using 2007.
I'm creating an American Football Statistics database and I have a table which I then created a form from that table. In that form I input a formula in design view into one of the fields. When I switch back to Form View, the formula works and the right value is given.
I complete the form, and then go to the table and data is missing in the fields where I've input a formula.
For example:

The Pass Attempts field and Yards made field are fields where I input data manually, but the Pass Completion % field (which has a formula) is automatically calculated. It works in the form and gives the value, but when I go back to the table, data is in the Pass Attempts and Yards fields, but no data is in the Pass Completion % field.

Is there a reason for this? It seems to happen with every database I make when I put a formula in a field on a form.

Thanks!
 
When you add an expression to the control source of the text box, you effectively unbind the control from the underlying table, and thus the value is not saved to the table. With that said, in general, you should not be saving calculated values in the table anyway; only the values that are used to perform the calculation should be saved. There are a few exceptions to this rule & based on your desciption, yours would not be one of those exceptions. Most calculated values are not saved because if one or more of the field values that are used in the calculation are changed, the calculated value is not automatically changed (like in a spreadsheet). If that happens, you lose data integrity. You would have to run an update query to actually update the calculated field. You would just calculate the value on the fly when you need it in forms, queries and reports.
 
there is nothing wrong with having calculated fields on forms. the way you store calced values in a table is by putting your expression in the default value property. but like it's said already, calced values have no place in tables.
 

Users who are viewing this thread

Back
Top Bottom