Set focus to a Control on a subform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

This is my problem. I have a form1 which has a subform1. On form1 I have a
button which opens form2. Once form2 is closed I want the focus to go to a
specific control (ctrl1) on subform1 in form1.

How can I do this programmatically on the OnClose in form2?

Thanks for any help!!!!!

Sarah
 
What you need to do is go into Visual Basic as you said on the OnClose event
and then add this code:

Forms![form1]![subform1]![ctrl1].SetFocus

Hope this helps
 
Thank you! That did the trick.

Have a Happy St. Patrick's Day!

Sarah

Chris said:
What you need to do is go into Visual Basic as you said on the OnClose event
and then add this code:

Forms![form1]![subform1]![ctrl1].SetFocus

Hope this helps

Sarah said:
This is my problem. I have a form1 which has a subform1. On form1 I have a
button which opens form2. Once form2 is closed I want the focus to go to a
specific control (ctrl1) on subform1 in form1.

How can I do this programmatically on the OnClose in form2?

Thanks for any help!!!!!

Sarah
 
Back
Top