Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't get 'BackColor' to work 1

Status
Not open for further replies.

HMJ

Technical User
Nov 29, 2002
58
US
I have a form where labels are highlighted when the field gets focus. The code I have used on this form so far is:
Code:
Private Sub DENTIST__PHONE_GotFocus()
    Me!Label19.BackColor = 8454143
End Sub
Private Sub DENTIST__PHONE_LostFocus()
    Me!Label19.BackColor = 12632256
End Sub
Now I am trying to add aditional fields and the same code does not work. i.e...
Code:
Private Sub MMR_GotFocus()
    Me!Label26.BackColor = 8454143
End Sub
Private Sub MMR_LostFocus()
    Me!Label25.BackColor = 12632256
End Sub
Anyone have any idea(s) why this won't work now?


Harry Jessen
HMJessen@Yahoo.com
 
Hi Harry,

Check the BackStyle value - if the Label is Transparent, changing the BackColor will have no visible effect.

Enjoy,
Tony

------------------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading FAQ222-2244 before you ask a question.
 
Also make sure you have your label names correct - I notice in the second part of your snippet above, the GotFocus event refers to Label26 and the LostFocus event refers to Label25.

Nelviticus
 
TONY:
Thank You!
I knew it had to be something simple that I was overlooking. That is what happens when you are in a time crunch!

NELVITICUS:
Thank You, too. That was a typo on my part when I was posting. As I said above - time crunch causes errors!




Harry Jessen
HMJessen@Yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top