Data in Textbox not storing on Table

M

Maria

Hello

I have a Textbox "SubTotal" that is bound (by calculations) to other fields
and has the following characteristics:

Name: SubTotal
Control Source: =([nm_Nodias]*[nm_Preciodia]+[nm_Porte])

When the record is saved - the data in SubTotal does not store in the table.
Is this because it's Control source is a calculation? If so, how do I go
about storing the data value?

Thank you in advance
Maria
 
F

fredg

Hello

I have a Textbox "SubTotal" that is bound (by calculations) to other fields
and has the following characteristics:

Name: SubTotal
Control Source: =([nm_Nodias]*[nm_Preciodia]+[nm_Porte])

When the record is saved - the data in SubTotal does not store in the table.
Is this because it's Control source is a calculation? If so, how do I go
about storing the data value?

Thank you in advance
Maria

When using Access, don't think spreadsheet, think relational database.

No need to store the result of this calculation.
As long as you have stored the various data parts needed in the
calculation, anytime you need the SubTotal, recalculate it.
 
M

Maria

Dear Linq and Fred:

The stored fields that are used for the calculations of SubTotal are saved
properly to the table.

I understand what you are saying but I would like to know IF it can be done.
I have a boss that likes to look at the table and he does not understand WHY
the values do not show in the table and yet they show in the form

Thank you
Maria


fredg said:
Hello

I have a Textbox "SubTotal" that is bound (by calculations) to other fields
and has the following characteristics:

Name: SubTotal
Control Source: =([nm_Nodias]*[nm_Preciodia]+[nm_Porte])

When the record is saved - the data in SubTotal does not store in the table.
Is this because it's Control source is a calculation? If so, how do I go
about storing the data value?

Thank you in advance
Maria

When using Access, don't think spreadsheet, think relational database.

No need to store the result of this calculation.
As long as you have stored the various data parts needed in the
calculation, anytime you need the SubTotal, recalculate it.
 
F

fredg

Dear Linq and Fred:

The stored fields that are used for the calculations of SubTotal are saved
properly to the table.

I understand what you are saying but I would like to know IF it can be done.
I have a boss that likes to look at the table and he does not understand WHY
the values do not show in the table and yet they show in the form

Thank you
Maria

fredg said:
Hello

I have a Textbox "SubTotal" that is bound (by calculations) to other fields
and has the following characteristics:

Name: SubTotal
Control Source: =([nm_Nodias]*[nm_Preciodia]+[nm_Porte])

When the record is saved - the data in SubTotal does not store in the table.
Is this because it's Control source is a calculation? If so, how do I go
about storing the data value?

Thank you in advance
Maria

When using Access, don't think spreadsheet, think relational database.

No need to store the result of this calculation.
As long as you have stored the various data parts needed in the
calculation, anytime you need the SubTotal, recalculate it.

Yes the calculated values can be saved in a table, but allowing a
"boss" (or anyone else) to look directly in the tables (instead of
using a form) is like allowing a 5 year old to play with matches in
the barn. :-(
It takes only a fraction of a second for someone, even the boss, to
inadvertently delete, change, or otherwise alter the data. What would
you do if one of the values used to calculate the SubTotal were to be
changed? You now have a SubTotal field that 'doesn't add up'.

Don't do it.... please.

If you need to display the data like a table, create a query that
displays all of the fields plus the calculated SubTotal data. Display
the query records in a form bound to this query (in Form Datasheet
View). It will look like a table, read like a table, and feel like a
table. Best of all, no one will be able to change existing data. And
the SubTotal will always 'add up'.
 
M

Maria

Dear Fred:

Thank you for the insight -- as this office is small - my boss has his
fingers in everything. I will take the time to explain to him the reasoning
why the fields do not get stored in the DB and will also create a report that
will display all fields or create a form with the quiery that you mentioned.

Thank you for everything
Maria

fredg said:
Dear Linq and Fred:

The stored fields that are used for the calculations of SubTotal are saved
properly to the table.

I understand what you are saying but I would like to know IF it can be done.
I have a boss that likes to look at the table and he does not understand WHY
the values do not show in the table and yet they show in the form

Thank you
Maria

fredg said:
On Mon, 6 Jul 2009 04:23:01 -0700, Maria wrote:

Hello

I have a Textbox "SubTotal" that is bound (by calculations) to other fields
and has the following characteristics:

Name: SubTotal
Control Source: =([nm_Nodias]*[nm_Preciodia]+[nm_Porte])

When the record is saved - the data in SubTotal does not store in the table.
Is this because it's Control source is a calculation? If so, how do I go
about storing the data value?

Thank you in advance
Maria

When using Access, don't think spreadsheet, think relational database.

No need to store the result of this calculation.
As long as you have stored the various data parts needed in the
calculation, anytime you need the SubTotal, recalculate it.

Yes the calculated values can be saved in a table, but allowing a
"boss" (or anyone else) to look directly in the tables (instead of
using a form) is like allowing a 5 year old to play with matches in
the barn. :-(
It takes only a fraction of a second for someone, even the boss, to
inadvertently delete, change, or otherwise alter the data. What would
you do if one of the values used to calculate the SubTotal were to be
changed? You now have a SubTotal field that 'doesn't add up'.

Don't do it.... please.

If you need to display the data like a table, create a query that
displays all of the fields plus the calculated SubTotal data. Display
the query records in a form bound to this query (in Form Datasheet
View). It will look like a table, read like a table, and feel like a
table. Best of all, no one will be able to change existing data. And
the SubTotal will always 'add up'.
 
J

John W. Vinson

Dear Fred:

Thank you for the insight -- as this office is small - my boss has his
fingers in everything. I will take the time to explain to him the reasoning
why the fields do not get stored in the DB and will also create a report that
will display all fields or create a form with the quiery that you mentioned.

Here's my boilerplate reply to this subject: feel free to share it with your
boss.

Storing derived data such as this in your table accomplishes
three things: it wastes disk space; it wastes time (almost
any calculation will be MUCH faster than a disk fetch); and
most importantly, it risks data corruption. If one of the
underlying fields is subsequently edited, you will have data
in your table WHICH IS WRONG, and no automatic way to detect
that fact.

Just redo the calculation whenever you need it, either as a
calculated field in a Query or just as you're now doing it -
in the control source of a Form or a Report textbox.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top