Table of contents
TOC
折叠目录
展开目录

Form.ViewsAllowed 属性 (访问)Form.ViewsAllowed Property (Access)

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

您可以使用ViewsAllowed属性来指定用户可以通过单击视图菜单上的窗体视图数据表视图命令或通过单击箭头查看数据表视图和窗体视图之间进行切换按钮然后单击窗体视图数据表视图。读取/写入字节You can use the ViewsAllowed property to specify whether users can switch between Datasheet view and Form view by clicking the Form View or Datasheet View command on the View menu or by clicking the arrow next to the View button and clicking Form View or Datasheet View. Read/write Byte.

语法Syntax

表达式视图expression. ViewsAllowed

表达式_一个表示窗体对象的变量。_expression A variable that represents a Form object.

注解Remarks

ViewsAllowed属性使用以下设置。The ViewsAllowed property uses the following settings.

设置Setting说明Description
00(默认值)用户可以在窗体视图和数据表视图之间切换。(Default) Users can switch between Form view and Datasheet view.
11用户不能从窗体视图切换到数据表视图。Users can't switch to Datasheet view from Form view.
22用户不能从数据表视图切换到窗体视图。Users can't switch to Form view from Datasheet view.

视图按钮列表中和视图菜单上显示的视图取决于ViewsAllowed属性的设置。例如,如果允许的视图属性设置为数据表,在视图按钮列表中和视图菜单上禁用窗体视图The views displayed in the View button list and on the View menu depend on the setting of the ViewsAllowed property. For example, if the ViewsAllowed property is set to Datasheet, Form View is disabled in the View button list and on the View menu.

下面两个属性组合使用将产生下列情况。The combination of these properties creates the following conditions.

默认视图DefaultView视图ViewsAllowed说明Description
单个或连续窗体,或者数据表Single, Continuous Forms, or Datasheet两者都有Both用户可在“窗体”视图和“数据表”视图之间切换。Users can switch between Form view and Datasheet view.
单个或连续窗体Single or Continuous Forms窗体Form用户不能从“窗体”视图切换到“数据表”视图。Users can't switch from Form view to Datasheet view.
单个或连续窗体Single or Continuous Forms数据表Datasheet用户可以从“窗体”视图切换到“数据表”视图,但不能反向切换。Users can switch from Form view to Datasheet view but not back again.
数据表Datasheet窗体Form用户可以从“数据表”视图切换到“窗体”视图,但不能反向切换。Users can switch from Datasheet view to Form view but not back again.
数据表Datasheet数据表Datasheet用户不能从数据表视图切换到窗体视图。Users can't switch from Datasheet view to Form view.

示例Example

下面的示例在“立即”窗口中显示一条消息,表明用户如何在数据表视图和“Switchboard”窗体的窗体视图之间进行切换的状态。The following example prints a message in the Immediate window indicating the state of how users can switch between Datasheet view and Form view for the "Switchboard" form.

Debug.Print "ViewsAllowed = " &; Forms.Item("Switchboard").ViewsAllowed

另请参阅See also

概念Concepts

窗体对象Form Object

© 2018 Microsoft