On the lost focus of the textbox, put something like (the control being
named txtAmount):
if isnumeric(txtamount) then
txtAmount = "R" & format$(txtamount, "0.00")
endif
The other way to do it (which I prefer) is to have a seperate field or a
label for the symbol physically prefixing the currency field so that the
code simply becomes:
if isnumeric(txtamount) then
txtAmount = format$(txtamount, "0.00")
endif
If you write a user control to do this, you only need to code it once and
you can use it anywhere.
PS. How is it down in sunny SA?
Mark Roworth
Dolphin Computing Ltd
01273 262865
mark.roworth@b...
-----Original Message-----
From: Mark Warner [mailto:margarete@a...]
Sent: 22 January 2003 13:02
To: professional vb
Subject: [pro_vb] Setting currency
Hi List
I need the user to enter an amount in a text box. I don't want $ to prefix
the value in the textbox, but rather our local currency (R). The problem
comes in that the users have no rights to change their regional settings.
Can I do this through VB? I would hazard a guess at an API call, but it's
the hazard bit that I'm hoping to avoid.
Any help will be most appreciated.
Kind Regards
Mark Warner
ABSA Direct
______________________________________________
"The information contained in this communication is confidential and
may be legally privileged. It is intended solely for the use of the
individual or entity to whom it is addressed and others authorised to
receive it. If you are not the intended recipient you are hereby
notified that any disclosure, copying, distribution or taking action
in reliance of the contents of this information is strictly prohibited
and may be unlawful. Absa is liable neither for the proper, complete
transmission of the information contained in this communication, nor
for any delay in its receipt, nor for the assurance that it is
virus-free."