Need help: tab order from header to detail section

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

Guest

I have a form with header and footer as well as detail section.
When the user tabs through the form, I want the cursor to make its way
through the header first and, then through the detail section and finally the
footer.
However, when the user presses the tab button the cursor just cycles through
the header and the user has to use the mouse to get the cursor to the next
section. What can I do to allow the user to be able to tab directly from
Header to Detail and then from Detail to footer?
 
Jane said:
I have a form with header and footer as well as detail section.
When the user tabs through the form, I want the cursor to make its way
through the header first and, then through the detail section and
finally the footer.
However, when the user presses the tab button the cursor just cycles
through the header and the user has to use the mouse to get the
cursor to the next section. What can I do to allow the user to be
able to tab directly from Header to Detail and then from Detail to
footer?

Add a text box to the header section, make it last in the tab order of
that section, and set these properties:

Name: txtTransferToDetail
Visible: Yes
Enabled: Yes
SpecialEffect: Flat
Width: 0
Height: 0
OnGotFocus: [Event Procedure]

Create the following event procedure for its GotFocus event:

Private Sub txtTransferToDetail_GotFocus()

Me!NameOfFirstControlInDetailSection.SetFocus

End Sub

(where "NameOfFirstControlInDetailSection" is replaced by the name of
the first control in the detail section that you want to get the focus.)

Although it is technically Visible, because of its (0, 0) height and
width, the text box txtTransferToDetail will not be visible to the user,
but when the user tabs from the last "truly visible" control in the
header section into the text box, it will automatically send the focus
to the control you named in the detail section.
 
Thanks Dirk, that was a great help and did exactly what i wanted it to do!

Dirk Goldgar said:
Jane said:
I have a form with header and footer as well as detail section.
When the user tabs through the form, I want the cursor to make its way
through the header first and, then through the detail section and
finally the footer.
However, when the user presses the tab button the cursor just cycles
through the header and the user has to use the mouse to get the
cursor to the next section. What can I do to allow the user to be
able to tab directly from Header to Detail and then from Detail to
footer?

Add a text box to the header section, make it last in the tab order of
that section, and set these properties:

Name: txtTransferToDetail
Visible: Yes
Enabled: Yes
SpecialEffect: Flat
Width: 0
Height: 0
OnGotFocus: [Event Procedure]

Create the following event procedure for its GotFocus event:

Private Sub txtTransferToDetail_GotFocus()

Me!NameOfFirstControlInDetailSection.SetFocus

End Sub

(where "NameOfFirstControlInDetailSection" is replaced by the name of
the first control in the detail section that you want to get the focus.)

Although it is technically Visible, because of its (0, 0) height and
width, the text box txtTransferToDetail will not be visible to the user,
but when the user tabs from the last "truly visible" control in the
header section into the text box, it will automatically send the focus
to the control you named in the detail section.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
Back
Top