?
Solved

Conditional formatting - non-std background colors?

Posted on 2006-04-20
6
Medium Priority
?
350 Views
Last Modified: 2012-06-21
I am using conditional formatting in a datasheet.  I want one of the conditions to produce a backcolor that is not among the std colors in MSAccess.

Is it possible to implement Conditional Formatting in code and select custom color codes?

Any sample code to sahre?

Thanks!
0
Comment
Question by:markp99
5 Comments
 
LVL 11

Expert Comment

by:EMCIT
ID: 16500278
After selecting the color in design view of your form, click "Define Custom Color". This offers you a complete pallette of the spectrum and you can create ANY color you want. I don't believe you can import a custom color.
0
 

Author Comment

by:markp99
ID: 16503421
emcit,

I can see "define custom color" while in design view.  I have created the shade I desire and added it to the custom color section of the color pallet.

However, when I select Conditional Formatting for a field on a form, I still only see the standard set of 40 colors.  My "custom color" is not visible in the pallet.

Am I doing something wrong, or maybe I misunderstood your reply?

Thanks,

mark
0
 

Author Comment

by:markp99
ID: 16503649
Found a solution:

1. Open the form in design view.

2. Select the field in question, choose Conditional Formatting (CF) from the
Format menu. Set the condition you want, and click any std color in the
pallet - say, red. Close the CF dialog.

3. Press Ctrl+G to open the Immediate Window.

4. Type this into the Immediate window:    
    ? Forms![FormName]![FieldName].FormatConditions(0).BackColor
Displays the current backcolor setting for condition 0 (first condition)
Red = 255

5. Now that you know the expression is working, you can assign the color you
want by entering:
    Forms![FormName]![FieldName].FormatConditions(0).BackColor = 65000

6. Save the form. In future, the CF on this text box will use the NEW
background color.

7. Repeat for other attributes and conidtions.


This question may be closed.

mark
0
 
LVL 58

Expert Comment

by:harfang
ID: 16513796
Hello,

You are right, there is no other way. In addition to the above, you can use, as for all color properties:

    .....BackColor = RGB(192,192,192)   ' three color components
    .....BackColor = &HFFFF00&            ' color as hex value
    .....BackColor = vbActiveTitleBar       ' system color constants (desktop theme)
    .....ForeColor = vbTitleBarText         ' logically ;)

This being said, it's of course a case for {http:/help.jsp#hi70} -- thanks for the detailed answer!

Cheers!
(°v°)
0
 

Accepted Solution

by:
GranMod earned 0 total points
ID: 16732841
PAQed with points refunded (250)

GranMod
Community Support Moderator
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
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…

864 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