On Wed, 9 Jan 2008 07:02:39 -0800 (PST), Stapes <(E-Mail Removed)>
wrote:
>Hi
>
>I have a form Order Form, with subforms Customer Details and Order
>Details. When the user uses the tab key, after the last field in
>Customer Details, it goes on to the next customer details record. What
>I want it to do is to go to the first field in the Order Details
>section.
>How can this be achieved?
>
>Stapes
The assumption is that you will be entering more than one record in the
subform. If that's not the case (or usually not the case), you can put an
additional textbox named txtRelay on the Customer Details subform. Make it
unbound, and last in the tab order; it must have its Visible property set to
true for it to get the focus, but you can make it tiny and/or hide it behind
some other control to avoid mouseclicking into it.
In its GotFocus event put code like
Private Sub txtRelay_GotFocus()
Parent!subOrderDetails.SetFocus
Parent!subOrderDetails.Form!controlname.SetFocus
End Sub
where subOrderDetails is the name of the Subform Control containing the Order
Details form object, and controlname is the name of the control on that form
which should first get the focus.
John W. Vinson [MVP]
|