Group:  Microsoft Access » microsoft.public.access.formscoding
Thread: Different format in Continous form

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Different format in Continous form
"Khaled M Eid" <khaled[ at ]darcairo.com> 22.09.2006 13:20:19
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



Re: Different format in Continous form
John Nurick <j.mapSoN.nurick[ at ]dial.pipex.com> 22.09.2006 19:22:31
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


On Fri, 22 Sep 2006 15:20:19 +0200, "Khaled M Eid" <khaled[ at ]darcairo.com>
wrote:

[Quoted Text]
>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
>
>

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net