David, What Duane is trying to tell you is that if col3 is always = col1 + col2 then there is no
need to store that value in your table. When you want to see the results use a calculated
control
to display the value in your reports/queries/forms like so.
Query: Design a new query based on the table in question. Drag col1 and col2 down to the query
grid. In the 3rd empty column type in =[col1]+[col2] in the Field row.
Form/Report: Place an unbound textbox on your form/report. Double-click it to open the
properties
window. Type in =[col1]+[col2] as the Control Source.
This way you don't waste space and should the values of col1 or col2 change you will always
display
the correct result without having to update col3.
Hope this helps!
--
Reggie
----------
david said:
Thanks for the reply. But the form query from table. There is no way to store
the result to the table?
:
No, you can't create a calculated field in a table. Did you understand my
previous comments about not storing a calculated value?
--
Duane Hookom
MS Access MVP
Can I sum other field put in col3 in the table design(not in default
value)?
So, I can query the same table see col1, col2, col3.
:
You can't reference other fields in the default value in table design.
You
could do this in a form. However, if col3 is always col1+col2 then I
would
not store their sum in another field.
--
Duane Hookom
MS Access MVP
Hello! Everybody
I create a simply table called table1. Three columns called col1,
col2,
col3
How do I sum column1 and column2 to column3 in the "default value" of
the
table design view? Put expression like =[col1]+[col2] ??? but when
save
it
says db engine does not recognize the field col1 in a validation
expression
or default value in the table 'table1' Thanks for the help.