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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing the ForeColor of a Subform Label

Status
Not open for further replies.

quest4

Technical User
Aug 27, 2001
735
US
Good morning folks, got a small question. On GotFocus I have been changing the ForeColor of the label and OnLostFocus I have been changing the ForeColor back. That all works great. In the main form I have a couple of SubForms, I would like to have the SubForm's Label change ForeColor while I am in the SubForm entering data and change the ForeColor back when I leave the SubForm. I have tried sever things already but nothing has gotten past the debugger yet. Any suggestions? Thank you agin to anyone rendering any assistance on the problem.
 
Code:
Private Sub NameOfSubform_Enter()
Me![NameofLabel].ForeColor = vbRed

End Sub

Private Sub NameOfSubform_Exit()
Me![NameofLabel].ForeColor = vbBlack

End Sub


If you put the top into the subform's On Enter event and the bottom into the same subform's On Exit event then you should be fine.

If I take a peek in your Windows, to fix a problem, does that make me a "Peeping Tom"? Hmmmmmmmmmmv [pc1][shocked]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top