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
|
|||
|
|||
cost calculations in a table
hi, I have set up a table for parts ordering and I want to do a calculation
in one of the fields. I have a unit cost field and a No of units ordered field and a total cost field. so I want to times No of units ordered by unit cost to give a total cost and have the result of the calculation display in the total cost field. How do I write the formula and where do I write it? please help |
#2
|
|||
|
|||
recommend you don't. rule of thumb is: don't store calculated values in
tables. you're storing the values you need for the calculation - UnitCost and NoOfUnits. since tables should not be used for data entry/display, you don't need to display the total cost in a table. just calculate the total cost "on the fly" whenever you need it elsewhere in the database .. in a query, use a calculated column, as TotalCost: [UnitCost] * [NoOfUnits] in a form or a report, you can use the calculated field from the query, or calculate and display the value in an unbound textbox where the ControlSource property is set to =[UnitCost] * [NoOfUnits] hth "access" wrote in message ... hi, I have set up a table for parts ordering and I want to do a calculation in one of the fields. I have a unit cost field and a No of units ordered field and a total cost field. so I want to times No of units ordered by unit cost to give a total cost and have the result of the calculation display in the total cost field. How do I write the formula and where do I write it? please help |
#3
|
|||
|
|||
I think/hope you're confusing terms for "fields", which exist in
tables, and "controls", which exist on Forms and Reports. Do not store calculated results in the database, calculate them each time they are needed. the data source for txtTotalCost can be =[Unit Cost] * [Units ordered] note that in the line above you are referencing fields. HTH -- -Larry- -- "access" wrote in message ... hi, I have set up a table for parts ordering and I want to do a calculation in one of the fields. I have a unit cost field and a No of units ordered field and a total cost field. so I want to times No of units ordered by unit cost to give a total cost and have the result of the calculation display in the total cost field. How do I write the formula and where do I write it? please help |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Help with relationship plase | Rock | General Discussion | 5 | July 4th, 2005 03:54 AM |
unable to repair inobox | Sudheer Mumbai | General Discussion | 1 | February 20th, 2005 11:55 AM |
Manual line break spaces on TOC or Table of tables | Eric | Page Layout | 9 | October 29th, 2004 04:42 PM |
Here's a shocker | Mike Labosh | General Discussion | 2 | October 26th, 2004 05:04 PM |
Semicolon delimited text query help | Al Guerra | Running & Setting Up Queries | 3 | August 12th, 2004 11:50 AM |