manging decimal symbol

G

Guest

Hello,
I'm developing an application that will be used both in Europe and in US.
The application will collect - among many other data - medicatons dosage.
Those data will be used in many procedure in the code behind the application
itself.
Now... In europe we use ',' for decimal symbol while in the US it is used
'.'. My question is... Does Access use always '.' for decimal symbol when
coding?. Something like with date data type that always use the format of
mm/dd/yyyy in code regardless of your regional setting?
And... there's a way to know which decimal symbol is curently used in the
computer were the apps runs? (I was thinking to some kind of API call..maybe).
Thanks,
Rocco
 
D

Douglas J. Steele

I'm not aware of Access insisting on . for decimal anywhere.

Randy Birch has code to read locale numeric information at
http://vbnet.mvps.org/code/locale/localenumerics.htm

Obligatory warning: Randy's site is aimed at VB programmers. There are
significant differences between the controls available for forms in Access
and in VB, meaning that sometimes his code won't port directly to Access.
This is one of these cases. In VB, you write to a text box using its Text
property. In Access, you cannot use the Text property unless the control has
focus. You'll need to change statements such as:

Text1.Text = GetUserLocaleInfo(LCID, LOCALE_SDECIMAL)
Text2.Text = GetUserLocaleInfo(LCID, LOCALE_STHOUSAND)

to

Me.Text1 = GetUserLocaleInfo(LCID, LOCALE_SDECIMAL)
Me.Text2 = GetUserLocaleInfo(LCID, LOCALE_STHOUSAND)

Perhaps simpler, though, would be to include something like Mid(CStr(1/2),
2, 1) to determine what the decimal character is (although you could then
run into problems with , vs. ; in the Mid statement!)
 

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