Applies ToMicrosoft 365 专属 Access Access 2021 Access 2019 Access 2016

适用对象

CheckBox 对象

OptionButton 对象

ToggleButton 对象

可以使用 TripleState 属性指定复选框、切换按钮或选项按钮将如何显示 Null 值。 布尔型,可读/写。

表达式.TripleState

表达式 必需。 返回“适用范围”列表中的对象之一的表达式。

备注

TripleState 属性使用以下设置。

设置

Visual Basic

说明

True

此控件将循环遍历“是”、“否”和“Null”值的状态。 当此控件的 Value 属性设置为“Null”时,它将变暗(呈灰显状态)。

False

(默认)此控件将循环遍历“是”和“否”值。 如果为“否”值,则会显示“Null”值。

注意: 可使用控件的属性表、宏或 Visual Basic for Applications (VBA) 代码设置 TripleState 属性。

可以在任意视图中设置此属性。

示例

以下示例显示详细描述窗体“frmOperations”上名为“Check1”复选框状态的消息。

Dim strTripleState As StringstrTripleState = Forms.Item("frmOperations").Controls.Item("Check1").TripleStateSelect Case strTripleState    Case True        MsgBox "For Check1, TripleState = " & strTripleState & _            ". The control will cycle through states for Yes, No, " & _            "and Null values. The control appears dimmed (grayed) " & _            "when its Value property is set to Null."    Case False        MsgBox "For Check1, TripleState = " & strTripleState & _            ". The control will cycle through states for Yes and No " & _            "values. Null values display as if they were No values."    Case Else        MsgBox "Can't determine the TripleState property for Check1."End Select 

需要更多帮助?

需要更多选项?

了解订阅权益、浏览培训课程、了解如何保护设备等。