Colors in VBA

B

Brennan

Hello:

I am writing some VBA code that will change the forecolor
of some report controls based upon a given condition. I
need about 7 colors. Where can I get a list of how to
refernce colors via VBA. So far I have used vbRed,
vbBlack and vbBlue. I tried vbPurple but it didn't work.

Any help would be appreciated

Brennan
 
D

Duane Hookom

I usually change a control on a form to the desired color and then copy the
number from the property to the code.
 
S

Stephen Lebans

If you type vbRed in the search box of the Object Browser window you
will get:
vbBlack
vbBlue
vbCyan
vbGreen
vbMagenta
vbRed
vbWHite
vbYellow

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
M

Marshall Barton

Brennan said:
Hello:

I am writing some VBA code that will change the forecolor
of some report controls based upon a given condition. I
need about 7 colors. Where can I get a list of how to
refernce colors via VBA. So far I have used vbRed,
vbBlack and vbBlue. I tried vbPurple but it didn't work.

Use the RGB function and you can invent your own colors.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top