User changeable value used in calculations

  • Thread starter Thread starter jody
  • Start date Start date
J

jody

I would like to utilize the same exchange rate value in a
few different calculations in my database. The rate
value will change periodically. There will only be one
value at any given time.

The calculation will be something like this:

If UnitPrice is U.S. dollars then, UnitPrice *
ExchangeRate, else UnitPrice.

1) How do I make it easy for the user to update the
exchange rate periodically?

2) How could I take that single value and incorporate it
in 2 separate calculations?

Any help is appreciated.

Cheers,
Jody
 
If your data base saves the exchange rate from each time it is used call it
each time the calculation is run. If you would prefer to have the valuse
entered each time the program is run create a text box to enter the value
in and reference the text box each time you run the calculation

Norm
 
1) How do I make it easy for the user to update the
exchange rate periodically?

Store it in a Table. At some point you might need multiple exchange
rates (Dollars/Euros, Dollars/Yen, Rubles/Dinars, ...) but if you only
need one now, just use a one-row one-field table.
2) How could I take that single value and incorporate it
in 2 separate calculations?

Use DLookUp() to look up the value in the table, or include the table
in your Query.
 
Very thought provoking comments, as usual John. I ended
up creating a one-to-many between tblExchRate and
tblSalesOrdDetail. A rate appears on many detail lines.

I set up a query that calculates a spread based on price
* exchange less cost * exchange. The query includes the
adjoining exchange rate field. I forced the first rate
(data element)into my calculation by including the
ExchRateID foreign key field with criteria of 1.

Thanks,
Jody
 
thanks for your input John/Norm. I eventually set up an
exchange rate table (with a single data value) and
included this field in a query calculation.

Cheers,
Jody
 
Back
Top