Skip to content

Latest commit

 

History

History
50 lines (30 loc) · 1.61 KB

Access.DoCmd.OpenTable.md

File metadata and controls

50 lines (30 loc) · 1.61 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
DoCmd.OpenTable method (Access)
vbaac10.chm4164
vbaac10.chm4164
Access.DoCmd.OpenTable
6461c8c1-7452-f812-8914-e46406c58eae
03/07/2019
medium

DoCmd.OpenTable method (Access)

The OpenTable method carries out the OpenTable action in Visual Basic.

Syntax

expression.OpenTable (TableName, View, DataMode)

expression A variable that represents a DoCmd object.

Parameters

Name Required/Optional Data type Description
TableName Required Variant A string expression that's the valid name of a table in the current database. If you execute Visual Basic code containing the OpenTable method in a library database, Microsoft Access looks for the table with this name first in the library database, and then in the current database.
View Optional AcView An AcView constant that specifies the view in which the table will open. The default value is acViewNormal.
DataMode Optional AcOpenDataMode An AcOpenDataMode constant that specifies the data entry mode for the table. The default value is acEdit.

Remarks

Use the OpenTable method to open a table in Datasheet view, Design view, or Print Preview. You can also select a data entry mode for the table.

Example

The following example opens the Employees table in Print Preview.

DoCmd.OpenTable "Employees", acViewPreview

[!includeSupport and feedback]