Solved

Programmatically define new color sceme and apply it to access 2007 db

Posted on 2008-10-15
4
573 Views
Last Modified: 2013-11-27
I have been religiously programming my new access 2007 database using theme colors.  Not the windows theme but the access 2007.  Text Light, Background Dark Header .. etc   is there a way i can make a module to define a new theme and apply it.  I would likely store that data in a small table that will dynamically set the colors based off of which user is logged in.

brandon
0
Comment
Question by:brandonjel
  • 2
  • 2
4 Comments
 
LVL 84
ID: 22727345
How are you defining the colors? If you're using system color constants then no, you cannot change those. If you're declaring your own constants then you could ...
0
 

Author Comment

by:brandonjel
ID: 22727977
I used the Office Theme Colors which i understood to be different from the windows theme ones.  So Text Light, Text Dark,  Background Dark Header,  etc   Sadly it looks like msaccess only has like 3 themes.. blue grey and black.   Just wish there were more available.  You said you could declare you own.?  How would i define that on the form color side? Can i declare a public variable like.. JP_Text_Light and just put =[JP_Text_Light] as the forecolor?

brandon
0
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 250 total points
ID: 22729529
Colors can be represented as numeric values ... for example, this is a very light Blue color:

16772319

If I want to use that, I'd declare it as a constant:

Public Const JP_Light_Blue = 16772319

And then I'd use it anywhere I need to do so ... you'll have to set your colors in code (for example, in your form's Open or Load event):

Me.txbFirstName.ForeColor = JP_Light_Blue
Me.txbLastName.ForeColor = JP_Light_Blue
etc etc

You'd declare those constants in a Standard Module, in the [General Declarations] section (top of the page).

However, I caution you in doing this ... there's a reason Office products use standard Themes, and while you may think the colors look "cool and modern", if you have to deploy this to several people you might find yourself with some disgruntled users. Many users set their machines to a particular theme because they like it, or because it helps them to see better, or because they have an older machine and cannot make use of the full range of colors on a modern machine. In general your app should conform to the USERS standards - you shouldn't make your user conform to your Apps standards.
0
 

Author Comment

by:brandonjel
ID: 22733739
yes very wise... i was just hoping to make it easier for the user to actually apply a different ms access theme.   Not necessarily create all my own.  I was hoping to create more options in the Access Options, Popular, Select Theme area.  then put that pull down in a custom ribbon.

brandon
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question