Stuart McLachlan
stuart at lexacorp.com.pg
Wed Feb 9 16:50:28 CST 2005
On 9 Feb 2005 at 17:30, Arthur Fuller wrote: > > I need the form to respond intelligently with its Currency columns. We > have mandated that only one currency can exist per sale (and all its > details), but said form must be able to switch from the $ sign to the > Euro sign to the Yen sign etc., based on the value of the CurrencyID > column. > > I have no idea how to do this. At the moment every amount has a $ sign > in front of it, even if the currency is Euros. Not only does it look > stupid, it confuses the users. > Use a form/subform approach with the currency definitions in the subform? Two alternatives: 1. The simple way - don't use currency formatting, use a numeric formatted display with a separate textbox for showing the currency. FWIW, in these situations I try to avoid currency symbols because of problems with code pages/character sets. In multiple currency applications I use the ISO4127 codes: EUR, USD, AUD, GBP, YEN, PGK etc. (see http://www.xe.com/iso4217.htm) 2. The more complex but also more accurate way, which takes into account that not all currencies use K0,000.00 formats (take a look at the number of options under Regional Settings - Currency) Set up a lookup table of currencies and their appropriate formats. Use a control naming scheme which identifies all currency fields (txtCurrXxxxxxxxxx?). In the on_current event and the currency field on_change event loop through the fields on the form and reset the Format property for these fields based on the lookup table. -- Stuart