Does anyone know where I can get a list of vb color codes, I had a table long time ago but I lost the file. It had the displayed color and it's vb code. Thanks in advance.
While that's a nice example database, mhartman, it doesn't really answer the question of providing a list of the Visual Basic colour constants, of which there are only eight. These are detailed in the help files that ship with access.
Both work the same; e.g., MyControl.ForeColor = acColorIndexWhite and MyControl.ForeColor = vbWhite produce the same result. The former just takes less memory.
And, were you aware that you can go into a form in design mode and set it's color using the color select, including creating your own shade, and then you can take the resulting number and assign it and get that color?
So, for example, if I go into the color select and decide on this washed out shade of blue, it returns this number: 13420970 which I can then assign via code -
MyControl.ForeColor = 13420970
If you go into the object browser (from a module page) and search for Color one of the things you will get back is a list of color codes including the codes that link to windows. I.e. a color that isn't a color but is rather an index to the table of Windows color codes that your machine uses. These things include the standard background, standard title bar, highlighted item colors, etc. etc. - so tht you can automagically integrate your color scheme to the Windows scheme. If you change schemes later, things using the color indexes follow the change.
Both work the same; e.g., MyControl.ForeColor = acColorIndexWhite and MyControl.ForeColor = vbWhite produce the same result. The former just takes less memory.
If you really wanted to get kinky, you can search the web for Excel color codes and find 56 combinations that are pre-defined for Excel (though you can use a custom color there, too.) You can then define a bunch of color constants to match the colors used by spreadsheets. A couple of oddball cases apply because some of those colors repeat (which is why there are only 56 colors, not 64). The repetition is for the automatic colors assigned when doing graphics things.