please help me save my job !

  • Thread starter Thread starter ibo4lyf
  • Start date Start date
I

ibo4lyf

Ok maybe it's not that dire, but I do need a hand :-) I am working on
a project (hence the name of the group) for work and need some help
with the database. I've created tables and synced them with forms.
The forms allow me to enter expresions within the cells but the data
calculated by the expresions is not reflected on the Tables? Any
suggestions?
 
Calculated values shouldn't be stored in the tables anyhow.
As fellow Access MVP John Vinson likes to say "Storing calculated data
generally accomplishes only three things: it wastes disk space, it wastes
time (a disk fetch is much slower than almost any reasonable calculation),
and it risks data validity, since once it's stored in a table either the
Total or one of the fields that goes into the total may be changed, making
the value WRONG."

Keep your calculations in queries.
 
Calculated values shouldn't be stored in the tables anyhow.
As fellow Access MVP John Vinson likes to say "Storing calculated data
generally accomplishes only three things: it wastes disk space, it wastes
time (a disk fetch is much slower than almost any reasonable calculation),
and it risks data validity, since once it's stored in a table either the
Total or one of the fields that goes into the total may be changed, making
the value WRONG."

Keep your calculations in queries.

--
Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
(no e-mails, please!)






- Show quoted text -

So keep the expressions out of the Forms. Got it. Thanks a bunch. I
actually didn't even think of it that way. The queries will
definately take care of it.
 
I'm not exactly sure what you mean my "expressions" but if you mean that your
are typing equations and stuff like that, and that you want to display the
results of those calculations, then you can do something like the following:

1. Create two textboxes on a form (txt_input, txt_output). In the
afterupdate event of txt_input enter code that looks like: me.txt_output =
Eval(me.txt_input)

This will evalute the expression you entered and display the results.

HTH
Dale
 
I'm not exactly sure what you mean my "expressions" but if you mean that your
are typing equations and stuff like that, and that you want to display the
results of those calculations, then you can do something like the following:

1. Create two textboxes on a form (txt_input, txt_output). In the
afterupdate event of txt_input enter code that looks like: me.txt_output =
Eval(me.txt_input)

This will evalute the expression you entered and display the results.

HTH
Dale





- Show quoted text -

Ya, I can get the expressions to calculate and display in the forms
that I have created. But they won't display the calculated data
(answers to the expresions) on the table. I was hoping that if it
was displayed on the table I could just query the calculated data.
Doug has pointed out that I can just calculate within the quiries.
 
So keep the expressions out of the Forms. Got it. Thanks a bunch. I
actually didn't even think of it that way. The queries will
definately take care of it.

No, it doesn't mean 'keep calculations out of the form'!
A form is a proper place for calculations, along with in a report or
in a query.
What Doug indicated was not to store the result of the calculation in
your TABLE.
 
No, it doesn't mean 'keep calculations out of the form'!
A form is a proper place for calculations, along with in a report or
in a query.
What Doug indicated was not to store the result of the calculation in
your TABLE.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail- Hide quoted text -

- Show quoted text -

Well I need to store the result of my calculation somewhere to query
later. If not stored on the table, then where can I store it?
 
Well I need to store the result of my calculation somewhere to query
later. If not stored on the table, then where can I store it?

You can create a query that will perform your calculations, then use that query to build other queries ... or you can
build your calculated value directly in a query ... for example, if you have two fields dQuantity and cPrice, and wish
to multiple them together, you'd do this in your query grid, in the Name row of a blank column:

TotalCost:dQuantity * cPrice

As long as you will always have access to the root values that make up your calculation, then there is no reason to
store this in the table, since you can always calcualte it as needed.

Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com
 
To be precise, you should not store a calculated value _that_ can be
recalculated whenever it is needed. If you have changing prices, you
probably _do_ want to store the price, or other calculated results using it
to have the applicable value as it was created.

Larry Linon
Microsoft Access MVP
 
Back
Top