ACC: How to Set Focus to a Subform Control Using GoToControlLast reviewed: October 24, 1997Article ID: Q95014 |
The information in this article applies to:
SUMMARYNovice: Requires knowledge of the user interface on single-user computers. To set the focus to a control on a subform, you can create a macro that uses the GoToControl macro action to move first to the subform, which is a type of a control, and then use the GoToControl action again to move to a particular control on the subform. 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:
ARTICLE-ID: Q150895 TITLE : ACC95: Microsoft Access Sample Forms Available on MSL ARTICLE-ID: Q175066 TITLE : ACC97: Microsoft Access 97 Sample Forms Available on MSL MORE INFORMATIONThe macro action GoToControl does not allow you to use the full syntax for the ControlName argument as:
Forms![orders]![orders subform]![ProductID] NOTE: In versions 1.x and 2.0, there is a space in Product ID.If you use this syntax, you may receive the following error message:
There is no field named ‘Forms![Orders]![Orders subform]![ProductID]’ in the current record.To work around this behavior, you need to set up a macro that first sets the focus to the subform control, and then sets the focus to a specific control on the subform. The following example demonstrates this technique using the sample database Northwind.mdb (or NWIND.MDB in version 2.0 or earlier). CAUTION: Following the steps in this example will modify the sample database Northwind.mdb (or NWIND.MDB in version 2.0 or earlier). You may want to back up the Northwind.mdb (or NWIND.MDB) file and perform these steps on a copy of the database.
REFERENCESFor more information about moving to a specific control, search for "GotoControl action" using the Microsoft Access 97 Help Index.
|
Additional query words: how to
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |