Currency symbol in regional settings

G

Guest

I would like to capture the currency symbol from the windows regional
settings into a string in a visual basic.
Can that be done?
 
D

Douglas J. Steele

Take a look at what Randy Birch has at
http://vbnet.mvps.org/code/locale/localecurrency.htm

Note: Randy's site is aimed at VB programmers, not Access programmers. There
are some significant differences between what controls are available for
forms in VB vs. in Access. This example is one of them. The code uses a
control array, which Access doesn't support. Consequently, you will not be
able to simply copy Randy's code into your Access program.

If all you want is the currency symbol, though. copy the declarations at the
top of his code (everything before Private Sub Form_Load()), and copy the
entire GetCurrentLocaleInfo function from the end of his code.

To get the system currency symbol, use

GetCurrentLocaleInfo(GetSystemDefaultLCID(), LOCALE_SCURRENCY)

To get the user's currency symbol, use

GetCurrentLocaleInfo(GetUserDefaultLCID(), LOCALE_SCURRENCY)
 
G

Guest

Thank you so much...

Douglas J. Steele said:
Take a look at what Randy Birch has at
http://vbnet.mvps.org/code/locale/localecurrency.htm

Note: Randy's site is aimed at VB programmers, not Access programmers. There
are some significant differences between what controls are available for
forms in VB vs. in Access. This example is one of them. The code uses a
control array, which Access doesn't support. Consequently, you will not be
able to simply copy Randy's code into your Access program.

If all you want is the currency symbol, though. copy the declarations at the
top of his code (everything before Private Sub Form_Load()), and copy the
entire GetCurrentLocaleInfo function from the end of his code.

To get the system currency symbol, use

GetCurrentLocaleInfo(GetSystemDefaultLCID(), LOCALE_SCURRENCY)

To get the user's currency symbol, use

GetCurrentLocaleInfo(GetUserDefaultLCID(), LOCALE_SCURRENCY)
 

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