Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / November 2006

Tip: Looking for answers? Try searching our database.

manging decimal symbol

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rocco - 06 Nov 2006 22:12 GMT
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
Douglas J. Steele - 06 Nov 2006 22:41 GMT
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!)

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)

> Hello,
> I'm developing an application that will be used both in Europe and in US.
[quoted text clipped - 11 lines]
> Thanks,
> Rocco
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.