Navigating Tabbed Pages

B

Brian Smith

If you have a form with a tab control on it with say four pages, what is the
difference in the Cycle property between Current Record and Current Page?
They both seem to have the same effect on navigation. Is there a way to tab
through all of the controls on all of the pages?

Also, if the Cycle property is set to All Records why do you end up going,
for example, from the last control on page 3 to the first control of page 3
on the next record (or new record)? Is this by design? What I would really
like to be able to do is to cycle through all of the controls and all pages
and then on the last control of the last page move to either the next record
or a new record. Is this possible?

I'd really appreciate some insight on the above.

Thanks.

Brian
 
K

Ken Snell [MVP]

Current Record and Current Page have to do with the form's Recordsource, not
with tabbed pages.

Each tab page has its own tab order, and tabbing from the last control of
the page will just go to the first control on that same page. You would need
to use VBA code to detect that you're leaving the last control and to then
set focus on the first control of the next page.

This can be done by the Exit event of that last control. Note however that
it can be tricky to teach the programming how to "read the user's mind" that
he/she is wanting to tab to another page instead of just wanting to leave
that last control and go someplace else.
 
B

Brian Smith

Ken, thanks for the insight on the Current Record and Current Page being
associated with a form's Recordsource. I sure didn't sense that was the case
from the Help file. Is the Help file article on Set Tab Order that wrong?

I understand your comments about the programming problems and thought that
would be an issue.

One thing that I would still like someone to explain is the All Records
setting of the Cycle property. In particular, why do you go from the last
control of Page X of a tab control to the same page of the next record and
not to either the next page of the current record or to the first page of
the next record. I'm just not understanding Microsoft's logic behind this
implementation.

Brian
 
K

Ken Snell [MVP]

The use of "page" in that Help article, I believe, is referring to a page of
a form -- forms can have multiple pages (vertically long forms, for
example), although I have never made a form that large before. It's
unfortunate that a form page and a tab control's page have the "same" term,
but they are different entities.

The All Records value for the Cycle property applies when focus is lost by
tabbing from the last control for a record to which the form itself is
bound. It has no effect until that last control is being tabbed out of.

One way to differentiate between a user "wanting to go to a different
control" and "tabbing to the next control" is to use a textbox with width
and height both zero. Have that textbox be the control in the tab order
right after that last control. Set the textbox's OnGotFocus property to run
a macro or VBA code that sets the focus where you want it. (This would be in
place of using the last control's Exit event to set the focus.) This almost
invisible textbox will get the focus only by tab order sequence (too small
for anyone to click into it except by sheer accident), so that helps reduce
the programming problems for deciding what the user meant to do.
--

Ken Snell
<MS ACCESS MVP>
 
B

Brian Smith

Yeah, it is unfortunate that they use the same terminology for two different
things. I knew what form pages are and assumed that the Cycle property
setting of Current Page referred to them as well as a tab control's page.
The concepts are definitely similar (at least to me) with the main
difference being the visual representation of the form is laid out. Maybe
someone from Microsoft will see this and either change the terminology or
add some tab control page specific properties related to tab order.

Thanks for the 0 x 0 text box idea. It should do exactly what I'm trying to
accomplish.

Brian
 

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