ComboBox.Selected 屬性 (Access)ComboBox.Selected property (Access)

您可以使用 Visual Basic 中的 Selected 屬性來確定是否已選取下拉式方塊中的某個項目。You can use the Selected property in Visual Basic to determine if an item in a combo box is selected. 可讀寫的 LongRead/write Long.

語法Syntax

運算式選取(lRow)expression.Selected (lRow)

_運算式_代表**ComboBox** 物件的變數。expression A variable that represents a ComboBox object.

參數Parameters

名稱Name 必要/選用Required/Optional 資料類型Data type 描述Description
lRowlRow 必要Required LongLong 下拉式方塊中的項目。The item in the combo box. 第一個項目以零 (0) 表示,第二個項目以一 (1) 表示,依此類推。The first item is represented by a zero (0), the second by a one (1), and so on.

註解Remarks

Selected 屬性是以零開始的陣列,包含下拉式方塊中每個項目的選取狀態。The Selected property is a zero-based array that contains the selected state of each item in a combo box.

設定Setting 說明Description
TrueTrue 已選取下拉式方塊項目The combo box item is selected.
FalseFalse 沒有選取下拉式方塊項目The combo box item is not selected.

此屬性只有在執行階段才能使用。This property is available only at run time.

您可以在 Visual Basic 中使用 Selected 屬性選取下拉式方塊中的項目。You can use the Selected property to select items in a combo box by using Visual Basic. 例如,下列運算式會選取清單中的第五個項目。For example, the following expression selects the fifth item in the list.

Me!Combobox.Selected(4) = True

支援和意見反應Support and feedback

有關於 Office VBA 或這份文件的問題或意見反應嗎?Have questions or feedback about Office VBA or this documentation? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.