Need help: tab order from header to detail section

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?
 
D

Dirk Goldgar

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.
 
G

Guest

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top