You can use the SelectObject action to select a specified database object (database objects: An Access database contains objects such as tables, queries, forms, reports, pages, macros, and modules. An Access project contains objects such as forms, reports, pages, macros, and modules.).
The SelectObject action has the following arguments.
||The type of database object to select. Click Table, Query, Form, Report, Macro, Module, Data Access Page, Server View, Diagram, Stored Procedure, or Function in the Object Type box in the Action Arguments section of the Macro Builder pane. This is a required argument.
The name of the object to select. The Object Name box shows all objects in the database of the type selected by the Object Type argument. This is a required argument, unless you set the In Navigation Pane argument to Yes.
Note The object names for Server View, Diagram, or Stored Procedure objects are not displayed in the Object Name box of an Access project (Microsoft Access project: An Access file that connects to a Microsoft SQL Server database and is used to create client/server applications. A project file doesn't contain any data or data-definition-based objects, such as tables and views.) (.adp).
|In Navigation Pane
||Specifies whether Microsoft Office Access 2007 selects the object in the Navigation Pane. Click Yes (to select the object in the Navigation Pane) or No (not to select the object in the Navigation Pane). The default is No.
The SelectObject action works with any Access object that can receive the focus (focus: The ability to receive user input through mouse or keyboard actions or the SetFocus method. Focus can be set by the user or by the application. The object that has focus is usually indicated by a highlighted caption or title bar.). This action gives the specified object the focus and shows the object if it's hidden. If the object is a form (form: An Access database object on which you place controls for taking actions or for entering, displaying, and editing data in fields.), the SelectObject action sets the form's Visible property to Yes and returns the form to the mode set by its form properties (form properties: Attributes of a form that affect its appearance or behavior. For example, the DefaultView property is a form property that determines whether a form will automatically open in Form view or Datasheet view.) (for example, as a modal (modal: A window or dialog box that requires the user to take some action before the focus can switch to another form or dialog box. Dialog boxes and messages are usually modal.) or pop-up form (pop-up form: A form that stays on top of other windows. A pop-up form can be modal or modeless.)).
If the object isn't open in one of the other Access windows, you can select it in the Navigation Pane by setting the In Navigation Pane argument to Yes. If you set the In Navigation Pane argument to No, an error message appears when you try to select an object that isn't open.
Often, you might use this action to select an object on which you want to perform additional actions. For example, if you have Access configured to use overlapping windows instead of tabbed documents, you may want to restore an object that has been minimized (by using the Restore action) or maximize a window that contains an object you want to work with (by using the Maximize action).
If you select a form, you can use the GoToControl, GoToRecord, and GoToPage actions to move to specific areas on the form. The GoToRecord action also works for datasheets (datasheet: Data from a table, form, query, view, or stored procedure that is displayed in a row-and-column format.).
To run the SelectObject action in a Visual Basic for Applications (VBA) module, use the SelectObject method of the DoCmd object.