Localised version and decimal comma

  • Thread starter Thread starter Joop
  • Start date Start date
J

Joop

In a localised version of Access2002 (Dutch) running on windows XP (Dutch) I
have problems executing queries in VBA. The queries use a single in the
WHERE part. As soon as I change the decimal character in the country
settings from , to . everyting works fine.

I have seen a solution, using REPLACE and CSng, somewhere some time agoo but
I can't find it anymore (looked in the knoledge base and DevelopersDex)

Who can help me with a solution??

regards Joop
 
Hi,



Basically, you can't relay on default formatting (from float to string)
since it will follow the default setting, as you know.

Instead of:

"prefix... " & myFloatingPointNumber & "...suffix "


try


"prefix..." & Replace(CStr(myFloatingPointNumber), ",", "." )
& "...suffix"



and that assumes you do not use , as 1000-separator, for sure.



Hoping it may help,
Vanderghast, Access MVP
 
Back
Top