IN THE SPOTLIGHT: MDE to MDB Conversion Service
(also supports: ACCDE to ACCDB, ADE to ADP, etc)
IN THE SPOTLIGHT: Access Database Repair Service
An in-depth repair service for corrupt Microsoft Access files
IN THE SPOTLIGHT: vbWatchdog
VBA error handling just got easier...
" vbWatchdog is off the chart. It solves a long standing problem of how to consolidate error handling into one global location and avoid repetitious code within applications. "
- Joe Anderson,
Microsoft Access MVP
Meet Shady, the vbWatchdog mascot watching over your VBA code →
(courtesy of Crystal Long, Microsoft Access MVP)
IN THE SPOTLIGHT: vbMAPI
An Outlook / MAPI code library for VBA, .NET and C# projects
Get emails out to your customers reliably, and without hassle, every single time.
Use vbMAPI alongside Microsoft Outlook to add professional emailing capabilities to your projects.
IN THE SPOTLIGHT: Code Protector
Standard compilation to MDE/ACCDE format is flawed and reversible.
Provided by allenbrowne.com, January 2004
If you can set the Format of a field or text box to "Currency", Access does not store this setting and does not respect the Regional Options of the user.
Secretly, Access stores the literal value of your currency settings, and only displays the word "Currency". The deception is discovered if you change your Regional Settings: suddenly all the formats no longer read "Currency", and the hard-coded value of your previous currency setting is revealed.
To demonstrate this issue:
Perhaps the Access designers thought this was clever: that a database with American dollars would still show dollars when opened in Italy or Israel. In my view, it makes no sense for Access to tamper with the settings we assign, i.e. if we hard-code settings they should remain intact, and if we use the adaptable setting "Currency", then Access should adapt. As it is, we are denied both choices.
All versions of Access work this way. The behaviour is counter-intuitive, inconsistent with the rest of regional settings, and contradicts the documentation. For example, the Access 2003 Help under Format Property - Number and Currency Data Types includes this (emphasis added):
Setting | Description |
General Number | (Default) Display the number as entered. |
Currency | Use the thousand separator; follow the settings specified in the regional settings of Windows for negative amounts, decimal and currency symbols, and decimal places. |
To develop an application that does correctly adapt to the user's currency settings, you must reset the Format property of every affected control every time you open a form or report. Use the Open event to reassign the word "Currency" to the Format property each text box, combo, etc.
For example, in the Orders form of the Northwind sample database, you need:
Private Sub Form_Open(Cancel As Integer) Me.Subtotal.Format = "Currency" Me.Freight.Format = "Currency" Me.Total.Format = "Currency" With Me.[Orders Subform].Form !UnitPrice.Format = "Currency" !ExtendedPrice.Format = "Currency" !OrderSubtotal.Format = "Currency" End With End Sub
Yes, it becomes tiresome. Maintenance is the greater problem: you must consider this issue with every change to a form or report in an internationalized application.
Home | Index of tips | Top |
Rate this article:
This is a cached tutorial, reproduced with permission.
Have your say - comment on this article.
What did you think of 'Currency format does not reflect regional settings'?
1. | Donn Edwards says... | 26 Mar 2009 |
This annoying bug still exists, even in Access 2007 SP1. See http://donnedwards.openaccess.co.za/2009/03/microsoft-access-and-ten-year-old.html |
iTech Masters | VAT: GB202994606 | Terms | Sitemap | Newsletter