How do I set the Tab Order for a Form Header section before the Form Details section?

M

Matthias Claes

I have a form that show it's Form Header & Footer sections (not Page
Header/Footer!).
However, when I open the form, the focus always goes to the first control in
de details section.
Can this behaviour be changed so that the tab order goes first to the header
section, and to the detail section afterwards?

Matthias Claes
matthias(-dot-)claes(-at-)stadsbader(-dot-)com
 
G

Gary Miller

Matthias,

If your form is in SingleForm mode, you can use OnCurrent
event of the form to put the focus on the control you want
in the header by using the SetFocus command.

Me!NameOfYourHeaderControl.SetFocus

If you do this with the first control in the Header Tab
Order you can then tab through the rest of the controls in
the Header. As the normal behaviour is to cycle back to the
first header control from the last one, in order to jump to
the detail section just as if it was a continuation of the
tab order I am going to borrow a nice method that Charlotte
Faust posted in another group.

Charlotte Faust suggested:
" The easiest way is to add an unbound control to each
section and make it 0"
width and 0" height, set its Locked property to true and set
the background
and borders transparent. Make it the last control in the
tab order for each
section. In the GotFocus event of the control, put in a
SetFocus
instruction for the control you want to go to next (i.e.,
the last control
in the header or footer would go setfocus to the first
control in the detail
section). If you want to jump to a control in the header or
footer
section, the easiest way is to create a hotkey by embedding
an ampersand in
the control's attached label. Then all the user has to do
is hold down the
alt key and type the underlined letter to move to that
control."

You can probably skip creating the invisible control on the
detail if you use the OnCurrent SetFocus above as that is
doing the same thing for you, but this would be the way to
skip to the detail from the last header control.

--
Gary Miller
Sisters, OR



"Matthias Claes" <matthias(-dot-)claes@stadsbader(-dot-)com>
wrote in message
news:[email protected]...
 

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