views:

163

answers:

3

Hi there,

Is it possible to have multiple currency denominations in a field?

I have a field that will have a currency value that will be either euro's or sterling dependent on whether or not the applicable record is in the currency zone.

Is this possible in Access or will i need to have seperate fields for euro/sterling?

Thanks in advance for any help

Noel

+2  A: 

I suggest you include a currency type column, that is, one amount column, one column for the currency that the amount is in. You may also wish to include a column for the value in your own currency for accounting purposes, that is, the amount credited by your bank.

Remou
+1, beat me to it :)
Lerxst
Thanks for the advice, would have liked to have been able to avoid the need for an extra column but this will work fine. Cheers
glinch
There isn't any other way to solve the problem, because it's two independent pieces of data and has to be in two different columns.
David-W-Fenton
A: 

ideally, you even have a tbl_Currency table, with:

id_Currency, PK, text, 3 characters (*)
currencyName, text

Then you can include an id_Currency FK field in other tables, where requested...

(*) 3 characters are enough to uniquely identify a currency as defined in the corresponding ISO currency list

Philippe Grondier
Is it really worth the overhead to have a surrogate key here? Why not save a join (which has to be an outer join in case you have Nulls in the currency field) and just store the 1-3 characters right in the record? You can even use it for defining a format on the fly. This is, in fact, how I do it, and have done so as recently as the last 6 months.
David-W-Fenton
A: 

Note that @Remou's suggestion to have a currency type field does not really take care of the issue of formatting the field. In a single-record form, you could use the OnCurrent event to set the currency format. But in a continuous or datasheet form, this won't work. You'd think this would be an ideal situation for the Conditional Formatting feature, but its crippled in only changing appearance (color, bold/italic, etc.) and can't change the format property.

So, you're really forced to either display the currency in a separate column, or you have to replace the currency value with an expression that formats the number according to the currency type. Unfortunately, that makes the field non-editable, so I'd likely got with the separate column if I needed an editable continuous/datasheet form.

However, note that this is one of the many reasons why I just don't make continuous/datasheet forms editable except in very limited circumstances. I tread them as expanded listboxes, for displaying data, rather than as edit controls. This means that replacing an editable field with an expression has no downside.

But I'm in a minority in that regard.

David-W-Fenton
Surely a separate column for the amount is not normal? What if a third currency is needed?
Remou
Er, what? Amount: 100, Currency: €. Seems to me that covers it, no? You can then use whatever currency you want.
David-W-Fenton
Now I am confused, is that not what I said? One column for amount and one for currency type? What is the point you are making in this post, which appears to recommend two columns for amount, as suggested by the OP?
Remou
Er, isn't my first sentence clear? Having two columns to store amount and currency type still leaves you with the problem of formatting the amounts for display/printing. And that's what my post is about, the details of how to make that work.
David-W-Fenton