Article ID: 154893 - Last Review: January 19, 2007 - Revision: 2.3 ACC: How to Move from Subform to Main Form by Using TAB or ENTERThis article was previously published under Q154893 SUMMARY
Moderate: Requires basic macro, coding, and interoperability skills.
This article demonstrates how you can press the TAB key or ENTER key to move from the last control on the last record of a subform to a specified control on the main form. NOTE: This article explains a technique demonstrated in the sample files, FrmSampl.exe (for Microsoft Access for Windows 95 version 7.0) and FrmSmp97.exe (for Microsoft Access 97). For information about how to obtain these sample files, please see the following articles in the Microsoft Knowledge Base: 150895
(http://support.microsoft.com/kb/150895/EN-US/
)
ACC95: Microsoft Access Sample Forms Available in Download Center
175066
(http://support.microsoft.com/kb/175066/EN-US/
)
ACC97: Microsoft Access 97 Sample Forms Available in Download Center
MORE INFORMATION
By default, Microsoft Access enables you to press the TAB key or ENTER key
to move the focus from one control to another control on a form, according
to the form's tab order. This includes moving to subform controls. However,
pressing the TAB or ENTER keys does not move the focus from a subform control back to the main form.
This article assumes that you are familiar with Visual Basic for Applications and with creating Microsoft Access applications using the programming tools provided with Microsoft Access. For more information about Visual Basic for Applications, please refer to your version of the "Building Applications with Microsoft Access" manual. NOTE: Visual Basic for Applications is called Access Basic in Microsoft Access version 2.0. For more information about Access Basic, please refer to the "Building Applications" manual. CAUTION: Following the steps in this example will modify the sample database Northwind.mdb (NWIND.MDB in version 2.0). You may want to back up the Northwind.mdb (or NWIND.MDB) file, or perform these steps on a copy of the Northwind database. NOTE: In the example below, you can remove the line of code that uses the Requery method of the subform control if you are using version 2.0. It is there for compatibility with the form's Cycle property, which is a new feature in version 7.0.
REFERENCES
For more information about setting a form's tab order, search for tab
order in forms, and then Change tab order in a form using the Microsoft
Access 97 Help Index.
For more information about the Bookmark property, search on the phrase Bookmark, and then view "Bookmark Property (Microsoft Access)" using the Microsoft Access for Windows 97 Help Index. APPLIES TO
| Article Translations
|


Back to the top
