Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

MSAccess Visual Basic Reference for the Color Gray

Posted on 2011-10-27
10
Medium Priority
?
416 Views
Last Modified: 2012-06-22
I have the following code, but it's not giving me a light gray color that i desire.  Is there another way to reference the field so that i can get a light gray color?

Also, I don't know why, but the line with CourseDateE comes back with an error.  Why?

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
   
    If [Purge] = True Then
        [EMPname].ForeColor = RGB(10, 10, 10)
        [Title].ForeColor = RGB(10, 10, 10)
        [CourseDateE].ForeColor = RGB(32, 32, 32)
    Else
        [EMPname].ForeColor = vbBlack
        [Title].ForeColor = vbBlack
        [CourseDateE].ForeColor = vbBlack
    End If
End Sub
0
Comment
Question by:eossma
10 Comments
 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 1200 total points
ID: 37039823
Those RGB colors are very close to black ...

0
 
LVL 120

Assisted Solution

by:Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1) earned 800 total points
ID: 37039824
try this value for gray  15132390

[CourseDateE].ForeColor = 15132390
0
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 1200 total points
ID: 37039843
Light Gray is going to be more like RGB(192,192,192)

mx
0
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.

 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 1200 total points
ID: 37039859
"Also, I don't know why, but the line with CourseDateE comes back with an error. "
What error ... and is there maybe a typo in the name ?

mx
0
 
LVL 120

Assisted Solution

by:Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1) earned 800 total points
ID: 37039865
also try rgb(190,190,190)
0
 
LVL 75
ID: 37039881
0
 
LVL 75
ID: 37039893
0
 
LVL 61

Expert Comment

by:mbizup
ID: 37039916
To get the exact color you want, set up a sample textbox or other control, select the background color you want, and use the value placed in the property sheet to get the same color through your code.
0
 

Author Closing Comment

by:eossma
ID: 37040012
Thank you all for the quick response.

capricorn1, 15132390 was too light.  
DatabaseMX, your RGB soluttion was closer . . . . but between the two of you I landed with RGB (150, 150, 150)

Also, DatabaseMX, after the error sugestion, I checked the label properties for the [CourseDateE] field and it didn't match the code; hence the error.

Thank you all.
0
 
LVL 75
ID: 37040050
Get this free tool:

http://www.colorschemer.com/colorpix_info.php

Instant install ... beyond handy for **quickly** getting the color on *anything visible* on your display. I use it frequently.

mx
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
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…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

564 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