MS Access: Changing the Color Scheme programmatically
Saturday, May 3, 2008
Microsoft Office 2007 comes with 3 colour (color) schemes.
Users can easily change it but when you deploy an Access application under the Runtime your users have no way to set the colour scheme as the application’s options are not available.
Luckily for us, Office 2007 stores the global colour scheme setting in the registry under:
HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Common\Theme
The values being stored under that key are:
- Blue scheme
- Silver scheme
- Black scheme
With this information, we can easily both read and set the colour scheme. The only caveat is that I could not find a way to notify Access to reload the setting automatically once it is changed, so users will have to restart the application before the change becomes active. A small price to pay but if anyone has a better idea, please let me know.
To write the new value to the registry I use a set of WIN 32 APIs that are more flexible than the default ones provided in VBA.

You can download the sample database as it contains all necessary files, including the definition for the Win32 API functions.
Download the ColorScheme.zip (31KB) containing the ACCDB database.
The sample also contains some code to restart the database. This is the subject of another post: Restarting and compacting the database programmatically.
Improvements/uses:
- Find a way for Access to reload the settings without having to restart the application.
- Use the knowledge about the current scheme to change the other colour settings in the application (or even adapt the form’s theme).
References:
- Setting the BackColor to match the Office 2007 color scheme
- API Get / Set Registry functions from http://www.arcatapet.net/.
Entry Filed under : Database, MSAccess, Programming

1 Comment Add your own
1. Access Team Blog&hellip | May 6th, 2008 at 8:47 am
Follow up to Transparency Forms…
Renaud posted some comments to the previous post about transparency forms and made some really cool enhancements…
Leave a Comment
Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
Trackback this post | Subscribe to the comments via RSS Feed