MSAccess Visual Basic Reference for the Color Gray

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
eossmaAsked:
Who is Participating?
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Light Gray is going to be more like RGB(192,192,192)

mx
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Those RGB colors are very close to black ...

0
 
Rey Obrero (Capricorn1)Commented:
try this value for gray  15132390

[CourseDateE].ForeColor = 15132390
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
"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
 
Rey Obrero (Capricorn1)Commented:
also try rgb(190,190,190)
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
0
 
mbizupCommented:
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
 
eossmaAuthor Commented:
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
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.