Back Color on a label (1 Viewer)

Trachr

Registered User.
Local time
Today, 02:06
Joined
Jun 1, 2014
Messages
90
on one of my forms I want the option to change the backcolor of a label and no matter what I try it wont work right.

Ive simplified the variables out of this code to try to figure out what im doing wrong but even the most simplified way it wont work so I figured Id ask here what Im doing wrong

Code:
Me.ColorlvlOne.BackColor = vbBlack

Any idea why that wont work? Ive tried with vb colors as well as RGB colors
 

GinaWhipp

AWF VIP
Local time
Today, 03:06
Joined
Jun 21, 2011
Messages
5,899
It will only work if you first set the Back Style to Normal. You need to add...

Code:
Me.ColorlvlOne.BackStyle = 1
...before your line.
 

Trachr

Registered User.
Local time
Today, 02:06
Joined
Jun 1, 2014
Messages
90
ah thank you :)
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 00:06
Joined
Aug 30, 2003
Messages
36,134
What does "wont work right" mean exactly? That code should work, presuming the label is on the same form/report the code is in (what event is it in?). Code would be problematic on a continuous form.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 00:06
Joined
Aug 30, 2003
Messages
36,134
This is what happens when you get distracted while typing. :p
 

bob fitz

AWF VIP
Local time
Today, 08:06
Joined
May 23, 2011
Messages
4,727
The Back Style property of the label needs to set to Normal
 

GinaWhipp

AWF VIP
Local time
Today, 03:06
Joined
Jun 21, 2011
Messages
5,899
@Trachr

Glad to help! Note, pbaldy is correct this will not work with a Continuous Form.
 

Users who are viewing this thread

Top Bottom