By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,397 Members | 1,425 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,397 IT Pros & Developers. It's quick & easy.

Form Controls Colors

P: n/a
Hi,

I have form with few rows of text boxes and labels. I tried to change colors
of labels, when txtBox gets focus, with code.

Private Sub txtBox1Row1_GotFocus()
Me!lblData1.BackColor = 6993407
End Sub

Private Sub txtBox1Row1_LostFocus()
Me!lblData1.BackColor = 16777215
End Sub

I have 3 text boxes in every row, so I put this code in every text box. This
works in one row.
This changing of colors dont work when try to implement this code in next
row of text boxes.

Private Sub txtBox1Row2_GotFocus()
Me!lblData2.BackColor = 6993407
End Sub

Private Sub txtBox1Row2_LostFocus()
Me!lblData2.BackColor = 16777215
End Sub

When moving focus to next row, label in next row doesn't change color.

Any help is greatly appreciated.

Thanks, Marco
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Are the names of your labels accurate? Is this being done in a continuous
fomr or datasheet?

"Marco Simone" <ma*********@hotmail.com> wrote in message
news:c0**********@ls219.htnet.hr...
Hi,

I have form with few rows of text boxes and labels. I tried to change colors of labels, when txtBox gets focus, with code.

Private Sub txtBox1Row1_GotFocus()
Me!lblData1.BackColor = 6993407
End Sub

Private Sub txtBox1Row1_LostFocus()
Me!lblData1.BackColor = 16777215
End Sub

I have 3 text boxes in every row, so I put this code in every text box. This works in one row.
This changing of colors dont work when try to implement this code in next
row of text boxes.

Private Sub txtBox1Row2_GotFocus()
Me!lblData2.BackColor = 6993407
End Sub

Private Sub txtBox1Row2_LostFocus()
Me!lblData2.BackColor = 16777215
End Sub

When moving focus to next row, label in next row doesn't change color.

Any help is greatly appreciated.

Thanks, Marco

Nov 12 '05 #2

P: n/a
> Are the names of your labels accurate? Is this being done in a continuous
fomr or datasheet?


Yes, label names are correct. This is on single form view.
Nov 12 '05 #3

P: n/a
Thanks for your help,

Somehow I manage this to work. I just tried with format painter on label
which changes colour to another label. Now it works.

Marco

"Marco Simone" <ma*********@hotmail.com> wrote in message
news:c0**********@ls219.htnet.hr...
Are the names of your labels accurate? Is this being done in a continuous fomr or datasheet?


Yes, label names are correct. This is on single form view.

Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.