Summing a calculated control

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hey,

I am trying to sum a calculated control on a form. I have read other
posts regarding rumming sums but none seem to help me. Here is what I have..

An Inventory database where I have 'tblItems' and 'tblInventory'
tblInventory contains a daily inventory of items... Each item has a cost that
is moved to tblInventory to store its cost at the time of inventory. I have
a calculated control that computes the Over/Short for the day for each Item.
I have another calculated control that determines the Cost of such
Over/Short. txtInventoryCost... I want to calculate the total Cost for that
particular day's Over/Short.

I have tried writting a little bit of code to store the cost in a variable
but not working for me... I cannot determine if the cost an update or a new
cost... so

var = var + Cost does not work here...

Any help world be great...

Ernst.
 
I am trying to sum a calculated control on a form. I have read other
posts regarding rumming sums but none seem to help me. Here is what I
have..

An Inventory database where I have 'tblItems' and 'tblInventory'
tblInventory contains a daily inventory of items... Each item has a cost
that
is moved to tblInventory to store its cost at the time of inventory. I
have
a calculated control that computes the Over/Short for the day for each
Item.
I have another calculated control that determines the Cost of such
Over/Short. txtInventoryCost... I want to calculate the total Cost for
that
particular day's Over/Short.

I have tried writting a little bit of code to store the cost in a
variable
but not working for me... I cannot determine if the cost an update or a
new
cost... so

var = var + Cost does not work here...

You have to recompute the value of the calculated control.

Example: Suppose your calculated control is named CalcCtrl and is computed
as

([Field1] + [Field2]) / 3

You can't do Sum([CalcCtrl])

Instead you have to Sum(([Field1] + [Field2]) / 3)

Tom Lake
 
Back
Top