Different format in Continous form

K

Khaled M Eid

Dear All,
I have a control in a continous form where I want to apply to it
different currency format for each row. i.e. one row $ format a second row a
Sterling format and so on)

Can anybody help
 
J

John Nurick

Hi Khaled,

You can do this by binding the form to a query that includes a
calculated field that returns the correctly formatted value for each
record.

For instance, if you have these fields in your table (I'll call it
CurAmts)
ID Amount CurCode
1 25 GBP
2 200 EUR
3 99.95 USD

and use a second table CurFormats to store the format for each currency:
CurCode CurFormat
EUR €#,##0.00
GBP £#,##0.00
USD $#,##0.00

this query
SELECT
CurAmts.ID,
CurAmts.Amount,
Format(CurAmts.Amount,CurFormats.CurFormat) AS FormattedAmt
FROM CurAmts INNER JOIN CurFormats
ON CurAmts.CurCode = CurFormats.CurCode
;

will return
ID Amount FormattedAmt
1 25.00 £25.00
2 200.00 €200.00
3 99.95 $99.95
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top