Help With Setting Colours.... Declaring A Constant?

CazB

Registered User.
Local time
Today, 23:29
Joined
Jul 17, 2013
Messages
309
Hopefully a simple question:

Access 2007:

I have a continuous form which, when it opens, uses code to display alternating colours... I need to set a default 'alternate' colour, and I want to find the code to use for Light Grey - on the design of a form, the color to use on a control would be #903C39 but when I try to set that as my default colour in the code it doesn't like it! I can use vbRed, vbBlue, vbYellow, etc, and that works perfectly but I can't find a vbLightGrey
wink.gif


Am I right in thinking I need to declare a Constant to do it? If so... how, please? If not.... what do I need to do instead?


TIA

Caz
smile.gif
 
CazB, not sure I just used #903C39, it came with Dark red.. Try.. #C4C4C4 for light grey..
 
oops yes I think I got the colour from the wrong control, lol.....

but it still won't accept me saying

myHighlightColor = #C4C4C4 where it WILL accept me using myHighlightColor = vbBlue

(the error I get is Compile Error: Expected: expression )
 
You are using that in Code.. Sorry.. If you are using it in code.. Use the RGB function to get the Long value for the color..
Code:
myHighlightColor = 12895428
[COLOR=Green]'Or
' myHighlightColor = RGB(196, 196, 196)
'Or you might need to play with this.. 
' As the Hex values not normally come up correct (atleast for me).. 
' myHighlightColor = &HC4C4C4[/COLOR]
 
Ok I've had a play with colours in Excel lol and I think I'll go with RGB(215,215,215) - will see if that works :)
 

Users who are viewing this thread

Back
Top Bottom