A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

cost calculations in a table



 
 
Thread Tools Display Modes
  #1  
Old September 20th, 2005, 10:15 PM
access
external usenet poster
 
Posts: n/a
Default 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  
Old September 20th, 2005, 10:44 PM
tina
external usenet poster
 
Posts: n/a
Default

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  
Old September 21st, 2005, 09:04 AM
Larry Daugherty
external usenet poster
 
Posts: n/a
Default

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 02:27 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.