Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2008-10-15
4
Medium Priority
?
598 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 85
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 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 1000 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

885 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