473,395 Members | 1,639 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

storing calculated values in a table

Hi All,

Any help or direction is much appreciated.

I've created a simple table in Access, including Name and Cost. I want to add a third field called Tax which will populate itself based on the value in the Cost record * .13.

I understand it would make more sense for this to be in a query, but I'm wondering if there is anyway to make it so then when a new record is added and say, 100 is typed into the cost field, 13 automatically shows up in the tax column based on the equation.

I guess this problem is something Excel would ovbiously handle perfectly, but it is necessary to use Access. If this cannot happen, is there anyway I can run a query of sorts and then add the results as a new column to the table.

The ultimate goal here is having the tax column as a part of the Table without manually calculating the values.

Thanks Anyone for their time...
Nov 13 '07 #1
2 1764
MikeTheBike
639 Expert 512MB
Hi All,

Any help or direction is much appreciated.

I've created a simple table in Access, including Name and Cost. I want to add a third field called Tax which will populate itself based on the value in the Cost record * .13.

I understand it would make more sense for this to be in a query, but I'm wondering if there is anyway to make it so then when a new record is added and say, 100 is typed into the cost field, 13 automatically shows up in the tax column based on the equation.

I guess this problem is something Excel would ovbiously handle perfectly, but it is necessary to use Access. If this cannot happen, is there anyway I can run a query of sorts and then add the results as a new column to the table.

The ultimate goal here is having the tax column as a part of the Table without manually calculating the values.

Thanks Anyone for their time...
Hi

The general rule is don't store anything that can be calculated!

As you rightly pointed out Excel will handle this perfectly, even to the point of recalculating the tax if the value is changed from 100. This would not happen in Access if you stored the calulation as 13.

It realy depends on what happens over time, eg. a calculation for an invoice which is fixed in time and will not depend on the value (100) or the tax rate (0.13) in the future, then do store the calculation (this will have to be done on a form even), if not then use a query.

That is my, very brief, explanation, but if anyone else would like to chip in ....

MTB

ps should the tax rate(s) be stored in a table ??
Nov 13 '07 #2
MMcCarthy
14,534 Expert Mod 8TB
As Mike said the storing of calculated values is not advised. However, if you need to do this and the tax rate is not likely to change then you can populate it using the data entry form. Set the default value of the control to

=[Cost] * 0.13

However, if the tax rate is subject to change then you will have to look at storing the tax rate somewhere and using a different approach.

You will also have to look at whether a change in the tax rate would historically change the values in the table as this is almost impossible with a calculated field which is why its not normally stored.
Nov 13 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Manfred | last post by:
Hi Would like to add a new Field to Table which is 75 % (or another Percentage) higher than the Value in another Field in same Table.Is this possible with Expression or would I have to enter the...
1
by: douh | last post by:
I know that this is not the way, however I need to save certian calculated values so that they do not change over time, ie. new tax rates etc. This is for an invoice header and invoice subform. I...
5
by: MX1 | last post by:
Oh boy, this is kind of a big one. I have a form with several calculated fields on spanning 5 rows. I somehow need to get the field values into a table. Challenge is I don't know how to do this....
9
by: Crirus | last post by:
I have ~200 players on a server... They share the same 512x512 tiles map... Each player have an explored area and a visible area... visible area is given by players's current units and...
8
by: TORQUE | last post by:
Hi, I am having some trouble with recording a field on a form into my Table after formatting it to calculate several fields on the form. If i just put the amount in the field and have it linked...
14
by: John Welch | last post by:
Hi all. I'm creating a FE/BE database that will be used by about 6 users. As usual, I have several fields, such as "OrganizationTypeID" that will get values (via combo boxes in forms) from separate...
11
by: James Hallam | last post by:
I have read through all the past topics and couldn't find what I was after so... I am looking to store some calculated values (don't flame just yet, just read on!). I have an piece of code...
2
by: jcf378 | last post by:
hi all. I have a form which contains a calculated control ("days") that outputs the # of days between two dates (DateDiff command between the fields and ). However, when I click "Filter by...
1
by: Prashantsd | last post by:
Hi, I have problem storing the calculated value in table. I have a text box(Ranking) which display the sum of 4 combo box. this is wat I hav done in control source of tex box = + + + I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.