Re: Problem reading Digit Grouping Symbol

Re: Problem reading Digit Grouping Symbol

am 27.11.2007 17:12:02 von Rick Rothstein

>I tried to retrieve the digit grouping symbol in MSAccess but
> unfortunately 3;0 is retrieved instead of comma which is my symbol.
> Function retrieves decimal symbol and list separator without any
> problem.

Here are non-API routines I use to retrieve the various regional setting
symbols and formats (use them exactly as posted, don't try to adjust them in
any way, they are correct as posted)... does the one I use for Thousands
Separator work for you?

DateSeparator = Format$(0, "/")

DecimalPoint = Format$(0, ".")

ThousandsSeparator = Mid$(Format$(1000, "#,###"), 2, 1)

Function DateFormat() As String
DateFormat = CStr(DateSerial(2003, 1, 2))
DateFormat = Replace(DateFormat, "2003", "YYYY")
DateFormat = Replace(DateFormat, "03", "YY")
DateFormat = Replace(DateFormat, "01", "MM")
DateFormat = Replace(DateFormat, "1", "M")
DateFormat = Replace(DateFormat, "02", "dd")
DateFormat = Replace(DateFormat, "2", "d")
DateFormat = Replace(DateFormat, MonthName(1), "MMMM")
DateFormat = Replace(DateFormat, MonthName(1, True), "MMM")
End Function

Function TimeFormat() As String
TimeFormat = CStr(TimeSerial(13, 22, 44))
TimeFormat = Replace(TimeFormat, "22", "mm")
TimeFormat = Replace(TimeFormat, "44", "ss")
If InStr(TimeFormat, "13") > 0 Then
TimeFormat = Replace(TimeFormat, "13", "HH")
If InStr(CStr(TimeSerial(1, 22, 44)), "0") = 0 Then
TimeFormat = Replace(TimeFormat, "HH", "H")
End If
Else
TimeFormat = Replace(TimeFormat, "1", "h")
TimeFormat = Replace(TimeFormat, "0", "h")
TimeFormat = Replace(TimeFormat, "PM", "tt", , , vbTextCompare)
End If
End Function


Rick