Sum calculated fields based on combo box columns

Giganews Newsgroups
Subject: Sum calculated fields based on combo box columns
Posted by:  zyzol‚Ķ@gmail.com
Date: Mon, 1 Dec 2014

Hello,

I have a main form (based on tblOrders) with 2 subforms (subform 1: based on tblOrderDetails and subform 2: based on tblExchangeRates)

I have a calculated field "Value" on a subform 1 (see below for definition), which uses data in columns of a combox.

How can I total all "Value" fields on the form (=sum() function does not see calculated fields)? What is the workaround?

Thank you for your help.

======
tblOrders (one side)
orderID (PK)
(other fields)

tblOrderDetails (many side)
orderElementID (PK)
orderID (FK)
elementName
Quantity
Price
CurrencyName
Value=IIf([currency].[column](0)='EUR';[quantity]*[price1pc]*1;[quantity]*[price1pc]*[currency].[column](1))
(other fields)

tblExchangeRates (many side)
exchangeRateID (PK)
orderID (FK)
currencyName
exchangeRateValue

PK - primary key
FK - foreign key

Replies