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

Subform focus

Status
Not open for further replies.

cdo3

Programmer
Aug 2, 2001
6
US
I have a form with a subform. On the subform I have a small box with a bock color of red. I want the box to turn green when the user has clicks on any control on the subform. I can't get the main form or subform gotfocus of lostfocus events to work. Can some one help me with this.
 
Form3 = Main Form
Form1 = Sub form
BOX11 = Rectangle on subform with background set to red

You'll have to do this for each control, or, make a public function and call it from each control (Saves typing)

Private Sub Text0_GotFocus()
Forms("form3")("form1").Form.Controls("Box11").BackColor = 11
End Sub

Private Sub Text0_LostFocus()
Forms("form3")("form1").Form.Controls("Box11").BackColor = 255
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top