The colour numbers are actually derived from the RGB colour system which you can see inn Visual Basic etc. Access displays them as decimal numbers, hiding their origins (!)
Think of the three primary colours - Red, Green and Blue - as having faders or 'volume controls' which can be set to any number from 0 (no colour) to 255 (brightest colour).
The colour numbers which you see in Access come from this formula:
RedValue + (Green Value * 256) + (BlueValue * 256 * 256)
The good news (?) is that there's an easy way to convert a colour which you choose visually, into a colour number. You can do this in Access, by creating e.g. a text box on a test form, or via a Windows program such as Paint.
In Access:
-- Choose the 'BackColor' property of your text box, and click the [...] ellipsis buton alongside.
-- Click the [Define Custom Colours] button.
-- Choose the colour you want by dragging the mouse round the colour box.
-- 'Fine tune' the colour by changing the values of the individual red, green and blue numbers.
-- When your colour is OK, click the [Add to custom colours] button.
-- Make the backcolor of your text box this custom colour.
You now have the 'colour number' you require, shown in the BackColor property of the text box.
You can use Paint in a similar way, but here you will need to write down the red, green and blue numbers, then multiply as shown earlier to get the number.
You can also change object colours programmatically, using the
RGB command:
Code:
Private Sub txtDemo_Click()
txtDemo.BackColor = RGB(255, 255, 0)
End Sub
In this example, when you click txtDemo, its back colour changes to bright yellow (red + green).
I hope these notes will help you to choose the new colour which you require.
Bob Stubbs (London, UK)