MS Access: Changing the Color Scheme programmatically

Saturday, May 3, 2008

Microsoft Access Microsoft Office 2007/2010 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.
(Article and Code Updated 01DEC2014.)

Luckily for us, the global colour scheme setting in the registry under the Key:

  • Office 2007: HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Common\Theme
  • Office 2010: HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Common\Theme
  • Office 2013: HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Common\UI Theme

The values being stored under that key are, For Office 2007 and Office 2010:

  • 1: Blue
  • 2: Silver
  • 3: Black

For Office 2013:

  • 0: White
  • 1: Light Gray
  • 2: Dark Gray

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.

Office 2007 Colour Schemes

You can download the sample database as it contains all necessary files, including the definition for the Win32 API functions.

DownloadDownload the (46KB) 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.


  • 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).


v1.4: 01DEC2014

  • Updated code for Office 2013 support.
  • Updated Registry API functions for compatibility with 64 bit Office
  • Combined all modules into OfficeScheme
  • Added new function to return the name of a Theme/current Theme in plain English.

v1.3: 31MAY2011

  • Updated code for Office 2010 support.
  • Autodetect correct registry key for Office 2007/2010

v1.2: 13FEB2009

  • Updated code for restarting the database.
    See exact changes at:

v1.1: 09AUG2008

  • Updated code for restarting the database.
    See exact changes at:
  • Added license notice to code.

v1.0: 03MAY2008

  • Original version


Entry Filed under  :  Database,MSAccess,Programming


  • 1. Access Team Blog&hellip  |  May 6th, 2008 at 08:47

    Follow up to Transparency Forms…

    Renaud posted some comments to the previous post about transparency forms and made some really cool enhancements…

  • 2. Windows Themes and Access&hellip  |  April 16th, 2010 at 19:32

    […] this link…grammatically/ Should help get you started. Dan Access Development […]

  • 3. Edwin Blancovitch  |  May 31st, 2011 at 04:31

    My friend..

    Can you provide us with the code to change the color code for office 2010…

    PD: Is there anyway to make this work for access only?


  • 4. Renaud  |  May 31st, 2011 at 09:57

    @Edwin: I updated the code and sample database to automatically detect the correct registry key for changing the theme.
    There is no simple way (AFAIK) to make this work for a single Office application as the Theme registry key is used by all of them.
    The only way I can think of would be to either use a Runtime version separate from the normal Office version the user has installed, or to contain the whole of the runtime installation in a virtualised application environment like ThinApp for instance.

  • 5. Stephen Poynter  |  August 25th, 2011 at 16:56

    DUDE that is awesome. Something so small yet so awesome thanks

  • 6. Klaus  |  November 25th, 2011 at 18:11

    Thank you!

    It works on a Win XP SP3 system with runtime 2007…

  • 7. Simeon Bartley  |  August 31st, 2012 at 12:19

    This code is great – but had a problem reading the current scheme on form load under windows 7 x64. The fix is the addition of a single ‘ByVal’ to the RegOpenKeyExA declaration as follows: ByVal dwOptions As Long. Credit is to the answer by DonBr at

  • 8. JC  |  April 16th, 2013 at 22:23

    Is there a way to control the color palette for MS Chart in Access? I can set any color I want in VBA but it always returns the closest match from a preset color palette. I there a way to control the colors in the preset color palette programmatically?

  • 9. Ray  |  August 13th, 2013 at 06:11

    wow, great work dud —> for “MS Access: Changing the Color Scheme programmatically” . I have being thinking about this for quiet a long time.

  • 10. Ray  |  August 13th, 2013 at 07:05

    I have being struggling working around access database called “SUSU_COLLECTOR.accdb” which has a form name “Susu” that contained a subform called “Susu_Tran”. I create a dialog box called “Deposit_Unit” which has 4 controls: “txtBox1”, txtBox2, “Ok” and “Cancel” button. I wanted to use the dialog box’s “txtBox1” and txtBox2 to add new records to the subform “Susu_Tran” on the Main form “Susu”, I had success adding new records to the subform “Susu_Tran” when it is opened in it own windows, but when I try to add new records to the subform on the Main form , am promted a run time error [SUSU_COLLECTOR can’t find the form ‘Deposit_Unit’ referred to in a macro expression or Visual Basic code]. Please any help is greatly appreciated.

  • 11. Renaud Bompuis  |  August 13th, 2013 at 16:00

    @Ray: I would recommend that you post your question on and include as much information as possible, including screenshots if possible. I’m sure you will have more chance of getting your issue resolved than here. This blog is not really the right venue for this.

  • 12. DaleO  |  November 24th, 2014 at 10:21

    Super sweet tool. I have a database that uses the Blue scheme as its default. Using the FileOptions form changes the scheme to Black and will also change it back to Blue. Selecting Silver has no effect. Any thoughts on why the Silver color will not work>

  • 13. Renaud Bompuis  |  December 1st, 2014 at 12:38

    @DaleO : I have updated the code to work with Office 2013.
    Regarding your issue, Office itself will change to the right scheme, but the values you select for the Background Color property of your forms ends up looking the same in the Silver and Black schemes.

  • 14. DaveH  |  December 23rd, 2015 at 17:08

    I wonder if this works on machines with Office 2003 installed using the 2010 runtime.

    I can’t seem to locate the registry entries where the runtime has been installed for this configuration.

    Anyway for all other installations is an elegant solution, well done.


This is a simple technical weblog where I dump thoughts and experiences from my computer-related world. It is mostly focused on software development but I also have wider interests and dabble in architecture, business and system administration.

My StackOverflow Profile My (sporadically active) StackOVerflow account

Most Recent Posts