I have created a form that has three subforms. Upon opening, the focus is on
the first field in the first subform. I want the focus to be on a text box
that resides on the main form so that I can easily use a command button to
search the main form. How do I set the focus to be the text box on the main
form?
Sprinks - 28 Feb 2006 16:21 GMT
In the OnOpen event procedure:
Me![YourTextBox].SetFocus
> I have created a form that has three subforms. Upon opening, the focus is on
> the first field in the first subform. I want the focus to be on a text box
> that resides on the main form so that I can easily use a command button to
> search the main form. How do I set the focus to be the text box on the main
> form?
AccessIM - 28 Feb 2006 16:45 GMT
Thank you for the quick response. That worked perfectly.
> In the OnOpen event procedure:
>
[quoted text clipped - 5 lines]
> > search the main form. How do I set the focus to be the text box on the main
> > form?
Dirk Goldgar - 28 Feb 2006 17:04 GMT
> I have created a form that has three subforms. Upon opening, the
> focus is on the first field in the first subform. I want the focus
> to be on a text box that resides on the main form so that I can
> easily use a command button to search the main form. How do I set
> the focus to be the text box on the main form?
Even easier than executing a code statement to set the focus, just make
that text box the first control in the main form's tab order.

Signature
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)