ACC: How to Set Focus to a Subform Control Using GoToControlID: Q95014
|
Novice: 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 action to first move to the subform (which is a
type of a control), and then uses 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:
Q150895 ACC95: Microsoft Access Sample Forms Available on MSL
Q175066 ACC97: Microsoft Access 97 Sample Forms Available on MSL
The 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 field
name.
There is no field named 'Forms![Orders]![Orders subform]![ProductID]' in the current record.
Macro Name Macro Actions
-----------------------------
GoToSubform GoToControl
GoToControl
GoToSubform Actions
-------------------------------
GoToControl
Control Name: Orders Subform
GoToControl
Control Name: ProductID (or Product ID in version 1.x or 2.0)
Caption: Enter/Modify Orders
OnClick (or OnPush in 1.x): GoToSubform
For more information about moving to a specific control, search for "GotoControl action" using the Microsoft Access 97 Help Index.
Additional query words: how to
Keywords : kbusage McrActn
Version : 1.0 1.1 2.0 7.0 97
Platform : WINDOWS
Issue type : kbhowto
Last Reviewed: March 19, 1999