If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
doing math in the table
Is it possible to have a field recieve calculated values from two other
fields? I tried it with a form (which does the math) but it doesn't actually add the data to the field. |
#2
|
|||
|
|||
No. And you don't do that in ACCESS anyway. If the value can be calculated
from two other fields, normally you do that in a query when you display the data. There are some times when you do store calcualated values, but when you must do that, use a query or a form to calculate the value and to put it into the table. -- Ken Snell MS ACCESS MVP "Jacques" JacquesLatoison at hotmail dot com wrote in message ... Is it possible to have a field recieve calculated values from two other fields? I tried it with a form (which does the math) but it doesn't actually add the data to the field. |
#3
|
|||
|
|||
On Wed, 22 Dec 2004 21:10:37 -0500, "Jacques" JacquesLatoison at
hotmail dot com wrote: Is it possible to have a field recieve calculated values from two other fields? I tried it with a form (which does the math) but it doesn't actually add the data to the field. 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. John W. Vinson[MVP] |
#4
|
|||
|
|||
Yes. Create a macro to set the value (Setvalue) of the field in the table
rather than a calculated contron on the form. If you want the form to dispaly the value, set the ":control Source"of the form field to display the value in the table. "Jacques" wrote: Is it possible to have a field recieve calculated values from two other fields? I tried it with a form (which does the math) but it doesn't actually add the data to the field. |
#5
|
|||
|
|||
It is generally recommended not to store calculated values in the
tables. Instead, calculate the values in a query. On Mon, 27 Dec 2004 01:59:08 -0800, Tom wrote: Yes. Create a macro to set the value (Setvalue) of the field in the table rather than a calculated contron on the form. If you want the form to dispaly the value, set the ":control Source"of the form field to display the value in the table. "Jacques" wrote: Is it possible to have a field recieve calculated values from two other fields? I tried it with a form (which does the math) but it doesn't actually add the data to the field. ********************** remove uppercase letters for true email http://www.geocities.com/jacksonmacd/ for info on MS Access security |
#6
|
|||
|
|||
Thanks everyone,
I'm going to do it with a form. I'm making a time sheet form for multiple users and wanted two things primarily: 1) When a user logs on, they can only see their timesheets in the table (I can't get my queries to allow data entry when the query filters by the user - but filtering based upon who logged in does work). This is one of the reasons I wanted to put the data in the table, because basing the form on the query instead of the tables isn't allowing for data entry (and no, view totals is not selected). 2) I want the users to be able to see the calculated TotalTime from the TimeIn and TimeOut fields, and I want the TimeIn and TimeOut to round off to the nearest quarter hour. "Jack MacDonald" wrote in message ... It is generally recommended not to store calculated values in the tables. Instead, calculate the values in a query. On Mon, 27 Dec 2004 01:59:08 -0800, Tom wrote: Yes. Create a macro to set the value (Setvalue) of the field in the table rather than a calculated contron on the form. If you want the form to dispaly the value, set the ":control Source"of the form field to display the value in the table. "Jacques" wrote: Is it possible to have a field recieve calculated values from two other fields? I tried it with a form (which does the math) but it doesn't actually add the data to the field. ********************** remove uppercase letters for true email http://www.geocities.com/jacksonmacd/ for info on MS Access security |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Duplicate data | Rob Green | Database Design | 3 | November 7th, 2004 03:08 AM |
Access & OleDb - generating schema changes, problem with identity/counter fields. | Thomas Tomiczek [MVP] | Database Design | 9 | November 5th, 2004 10:32 AM |
Automatic filling of fields in table two from table one | Jim Kelly | Database Design | 1 | September 27th, 2004 10:16 PM |
Autonumber | Ally H. | General Discussion | 7 | August 27th, 2004 04:51 PM |
Name not showing ID is | René | Setting Up & Running Reports | 11 | June 29th, 2004 01:40 AM |