From: Graeme on 26 Mar 2010 15:23 Hello The fields A B and C are all bounded to the same table. I am calaculationg C the values A and B are being intered into the form. First I input a value for A, than I input a value for B, and the result comes in C. --- frmsrcurl: http://msgroups.net/microsoft.public.access/Mathematical-Calculations-in-a-form-linked-back-to-a-table
From: John W. Vinson on 26 Mar 2010 16:18 On Fri, 26 Mar 2010 12:23:19 -0700, Graeme <user(a)msgroups.net/> wrote: >The fields A B and C are all bounded to the same table. I am calaculationg C the values A and B are being intered into the form. First I input a value for A, than I input a value for B, and the result comes in C. Well, just let me reiterate what everyone else is correctly telling you: Field C *SHOULD SIMPLY NOT EXIST IN YOUR TABLE*. 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 in the control source of a Form or a Report textbox. -- John W. Vinson [MVP]
From: Jeff Boyce on 26 Mar 2010 18:16 You may be facing one of those quite rare situations in which it it appropriate to store a calculated value... but you haven't given us much to go on. If you'll provide a more specific description of what you are dealing with, folks here may be able to offer more specific suggestions. If you don't, then the odds are you shouldn't do it the way you're trying to... More information, please ... or not! Regards Jeff Boyce Microsoft Access MVP -- Disclaimer: This author may have received products and services mentioned in this post. Mention and/or description of a product or service herein does not constitute endorsement thereof. Any code or pseudocode included in this post is offered "as is", with no guarantee as to suitability. You can thank the FTC of the USA for making this disclaimer possible/necessary. "Graeme" <user(a)msgroups.net/> wrote in message news:eGioLnRzKHA.3264(a)TK2MSFTNGP06.phx.gbl... > Hello > The fields A B and C are all bounded to the same table. I am calaculationg > C the values A and B are being intered into the form. First I input a > value for A, than I input a value for B, and the result comes in C. > > --- > frmsrcurl: > http://msgroups.net/microsoft.public.access/Mathematical-Calculations-in-a-form-linked-back-to-a-table
From: roccogrand on 27 Mar 2010 01:28
Graeme, The How To: For your form(s), Switch into Design View. Add a TextBox to the form. In the data part of the field, type =[A]-[B] In the label part of textbox, type your label. Exit Design View. For your reports, do the same. For more complicated calculations remember what you learned in algebra about the associative rule and parentheses. Test your calculations with sample data. HTH David "Graeme" wrote: > Hello > I palnning on implementing calculation between two fields, and the result within another field. Suppose I have three fields called A B and C respectively. In the form I plan on Inputing a value for[A] and Inputing a value for [B]. Now, Field [C] will calculate [A]-[B]. When filed [C] is calculated, it is not in the table, like A and B are. I would like to know how to solve this problem. > > --- > frmsrcurl: http://msgroups.net/microsoft.public.access/ > . > |