OpenTable Macro Action
You can use the OpenTable action to open a table in Datasheet view, Design view, or Print Preview. You can also select a data entry mode for the table.
The OpenTable action has the following arguments.
|Table Name||The name of the table to open. The Table Name box in the Action Arguments section of the Macro Builder pane shows all tables in the current database. This is a required argument.
If you run a macro containing the OpenTable action in a library database, Microsoft Microsoft Office Access 2007 looks for the table with this name first in the library database, then in the current database.
|View||The view in which the table will open. Click Datasheet, Design, Print Preview, PivotTable, or PivotChart in the View box. The default is Datasheet.|
|Data Mode||The data entry mode for the table. This applies only to tables opened in Datasheet view. Click Add (the user can add new records but can't edit existing records), Edit (the user can edit existing records and add new records), or Read Only (the user can only view records). The default is Edit.|
This action is similar to double-clicking the table in the Navigation Pane, or right-clicking the table in the Navigation Pane and selecting a view.
To run the OpenTable action in a Visual Basic for Applications (VBA) module, use the OpenTable method of the DoCmd object.