Subject: Conditional criteria in query
Posted By: dfuas Post Date: 1/14/2006 7:57:35 PM
Hi,

I have a query in which I try to calculate field values depending on the currency and foreign exchange rates.
I have a currency field with the amount value and a combo box where I select the currency for that amount which can be (USD, Euro, BRL, or INR). I have got also another 4 fields with each of currency foreign exchange rates.
I am trying to obtain a new calculated field of Price in Euros if the amount I have in the 1st field is not already in Euros.

Example:

Say:

Field 1-------amount
                      

Field 2---------currency (can be in USD or Euro or BRL or INR
                           depending on a refNo)

Field 3-------------xchange rate
 

Field of Results-------------field1 * field 3 in Euro depending
                             on the currency in field 2.

 
Can anyone help, plese?

thank you

dfuas




Reply By: AccessMaster Reply Date: 1/21/2006 2:39:32 AM
It really is better to the calculation on a form or report and not is a query.

I would create a User Defined Function (UDF) that calculates the value you need. Then you can call it from your query, form, or report.

Boyd
"Hi Tech Coach"
Access Based Accounting/Business Solutions developer.
http://www.officeprogramming.com

Go to topic 38745

Return to index page 389
Return to index page 388
Return to index page 387
Return to index page 386
Return to index page 385
Return to index page 384
Return to index page 383
Return to index page 382
Return to index page 381
Return to index page 380