Backcolor Property

ddrew

seasoned user
Local time
Today, 23:21
Joined
Jan 26, 2003
Messages
911
Im trying to set a backcolor property on 2007 in vba, I can use the vbRed etc but when I put numbers in it dosent like it. The numbers start with a #, I belive this is new, how do I get it work? Thanks
 
From the form, set the backcolor property to the color you want.
Then go to the immediate window and type ? YourForm.form.backcolor
It will tell you the number that corresponds to the color you've selected.
Then use that number in your vba.
hth,
..bob
 
From the form, set the backcolor property to the color you want.
Then go to the immediate window and type ? YourForm.form.backcolor
It will tell you the number that corresponds to the color you've selected.
Then use that number in your vba.
hth,
..bob

Whats the "Immediate Window"
 
Hit CTRL G and hit Enter.
This will bring up your immediate window.
From there you can type commands to check things.
if you type the ? it means print so.....
if you did something like ? YourForm.Form.Name ... it would return the name of your form.
 
Ok so I want to find the backcolor of a lbl so:
Code:
frm_AssetAllocation.lbl_A1.backcolor

didn't work so Im clearly still doing something wrong
 
Try...

? Forms![frm_AssetAllocation].Form.lbl_A1.backcolor
 
Colour can also be specified with the RGB function:
RGB(r, g, b) where r,g and b are integers from 0 to 255 representing the saturation of red, green and blue respectively.
 

Users who are viewing this thread

Back
Top Bottom