ACC: How to Create a Cyclic Tab Order in a FormID: Q112064
|
Moderate: Requires basic macro, coding, and interoperability skills.
This article describes a technique that you can use to create a cyclic tab
order on a form, so that pressing TAB in the last control on a form moves
you back to the first control on the form (instead of moving you to the
first control on the next record); and pressing SHIFT+TAB in the first
control on a form moves you to the last control on the form.
NOTE: In Microsoft Access 7.0 and 97, the cyclic tab order of a form can
be controlled by setting the form's Cycle property to All Records, Current
Record, or Current Page. The information below applies to Microsoft Access
versions 1.0, 1.1, and 2.0 only.
The following example demonstrates how to create a cyclic tab order on the
Customers form in the sample database NWIND.MDB. This technique uses two
transparent command buttons, one at the top and one at the bottom of the
form's tab order. When you press TAB in the last control, or SHIFT+TAB in
the first control, you run a macro attached to the OnEnter property of the
transparent command button at the top or bottom of the form's tab order.
MacroName Action
-----------------------
GotoFirst GotoControl
GotoLast GotoControl
GotoFirst Actions
------------------------
ControlName: Customer ID
GotoLast Actions
----------------
ControlName: Fax
Command Button
------------------------------------
ControlName: btnGotoLast
OnEnter: CyclicCustomers.GotoLast
Transparent: Yes
Command Button
-------------------------------------
ControlName: btnGotoFirst
OnEnter: CyclicCustomers.GotoFirst
Transparent: Yes
OnOpen: CyclicCustomers.GotoFirst
For more information about the Cycle property, search the Help Index for "cycle," or ask the Microsoft Access 97 Office Assistant.
Additional query words: circular
Keywords : FmsEvnt
Version : 1.0 1.1 2.0 7.0 97
Platform : WINDOWS
Issue type : kbhowto
Last Reviewed: April 2, 1999