473,386 Members | 1,943 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,386 software developers and data experts.

Is it possible to append the result of a calculated text box on a form to a table

Hi all. I am total newbie to Access so any help is greatly appreciated. I am creating a simple database in Access 2003 that captures details of an operation event.

I created a form for the user to enter the details of the operation event. I also created a calculated text box on the form that has an expression that takes the values the user entered into the form and spits out a value.

Is their a way to append(i'm not sure if that's the right terminology) the value from the expression on the form to a table in the database?

Thanks in advance.
Jan 5 '10 #1
9 2464
orangeCat
83 64KB
@dombrost
I'm sure it's possible, but many here will question you as to why you want to store a calculated value. Perhaps you could describe what you're dealing with and what exactly you want to store.
Jan 5 '10 #2
I would like to be able to pull a report from the table that has the field values and calculated value from the form. I tried creating a query that has the same expression from the calculated text box on the form. When I went to use the report wizard it said I could only use fields from either a table or query and not both. The answer might be obious- should I just create a query that contains the expression and the field I want from my table?

Thanks for your time.
Jan 5 '10 #3
missinglinq
3,532 Expert 2GB
You don't need a separate query to do this. You simply place an unbound textbox on your report and then do the same calculation you did on the form.

As orangeCat suggested, it is seldom necessary or advisable to store calculated values. There are some reasons for doing so, but this is certainly not one of them.

Welcome to Bytes!

Linq ;0)>
Jan 5 '10 #4
That sounds good. Thank you all for your help.
Jan 5 '10 #5
so what would be a good reason for storing a calculated value? and why would one argue against it?
Jan 5 '10 #6
nico5038
3,080 Expert 2GB
Storing calculated values is against normalization rules (e.g. check out http://en.wikipedia.org/wiki/Database_normalization).
The only reason for storing calculated values is the fact that the response time for processing the source data is too long and the calculated values are used multiple times. This will however hold the risk that the calculated values are "out of sync" with the actual data.....

Nic;o)
Jan 5 '10 #7
Stewart Ross
2,545 Expert Mod 2GB
In most circumstances, calculated values do not need to be stored as to do so would introduce unnecessary redundancy in the stored data. For example, in a purchase order database it would be redundant to store the subtotal of the order line quantity and unit cost, as this can be calculated as necessary from its components.

In some cases additional information is needed (for example, the actual tax rate for an item prevailing at the time of sale, or the rate of any discount applied) which would have to be stored with the other data for that row in the table. This would still not require that the overall subtotal inclusive of tax or discount, say, be stored. There is simply no need as long as the components of the calculation are present and correct.

As Nico said, storing calculated values breaches normalisation rules - the calculated data represents a functional and possibly transitive relationship between two or more fields within the row concerned. The calculated field depends on the nature of the function and any transitive relationship involved; it is not determined entirely by the unique key of the row.

That is, the calculated value is a function of its components f(a, b, ..., n) where a, b, ..., n are the fields which feed into the function concerned. A simple function may involve just one variable (e.g. multiplication by a constant), but in the purchase order example there up to four variables (quantity, unit cost, tax rate, discount rate).

Whilst the value of the components of such a calculation are related to the unique key (as they represent real-life attributes of, say, the purchase order line concerned), the calculated field is dependent not on the key but on the values of the components. It therefore breaks normalisation rules, which require that the value stored be wholly dependent on the unique key for that row (i.e. that the value represents some real-life attribute that we must store in order to have sufficient information to model the item concerned).

Functional and transitive relationships between fields are normalised out as part of the process of database design to reach 3NF or higher forms.

-Stewart
Jan 5 '10 #8
NeoPa
32,556 Expert Mod 16PB
Further reference on this point may be found at Normalisation and Table structures.

Written by one of our own members and as well explained as I've found - especially for those new to the subject.
Jan 6 '10 #9
NeoPa
32,556 Expert Mod 16PB
A new question was posted in here and has now been split off into Normalisation Related.
Feb 4 '10 #10

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

Similar topics

14
by: Allen Browne | last post by:
Subform is based on a single-table query that contains a calculated field: Amount: Round(CCur(Nz(*,0)),2) Continuous subform displays this field in a text box named Amount. As user enters new...
1
by: Miguelito Bain | last post by:
hi everybody. i'm trying to find out what you can and can't do with/in calculated fields. any help, pointers, and/or advice would be greatly appreciated. i'm a newbie, but i want to learn, and...
4
by: Clint Stowers | last post by:
Running Ak2 Daily there is a report that is run where a summation of the detail records is placed in the footer. Simple standard operation. What I would like to do at the time the report is...
2
by: Paolo | last post by:
Friends, I have a table with a field named Initials which has its record source to another table named Initials. I would like to add on a form named Welcome two controls: A combo box, which...
2
by: Mark | last post by:
I have a FE/BD 2002 DB on a XP pro platform. I know this is ugly but it works for me...... A text file is produced from our Oracle WMS. (Average 20k records) A command button deletes all records...
13
by: Alison Givens | last post by:
....... that nobody knows the answer. I can't imagine that I am the only one that uses parameters in CR. So, my question again: I have the following problem. (VB.NET 2003 with CR) I have a...
10
by: loisk | last post by:
Hi If anyone helps me on this problem, I'd greatly appreciate it! I have a field name, updatedName, in my database that is the same as originalName for a user to start. I also have two text...
2
by: sbettadpur | last post by:
Hi everybody, Hi iam strugling with more than one submit buttons with in one form here is my code <form method="post" action="Offer.php" name='issueFrm' onSubmit="return fullOfferfields();">...
3
allingame
by: allingame | last post by:
Need help with append and delete duplicates I have tables namely 1)emp, 2)time and 3)payroll TABLE emp ssn text U]PK name text
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.