Solved

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

Posted on 2008-10-15
4
565 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

777 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