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

您可以使用 ColumnHeads 屬性來顯示單一資料列的資料行標題的清單方塊、 下拉式方塊和接受欄名的 OLE 物件。You can use the ColumnHeads property to display a single row of column headings for list boxes, combo boxes, and OLE objects that accept column headings. 您也可以使用這個屬性來建立圖表控制項中的每個項目標籤。You can also use this property to create a label for each entry in a chart control. 內容實際顯示為第一列資料行標題取決於該物件的 RowSourceType 屬性設定值。What is actually displayed as the first-row column heading depends on the object's RowSourceType property setting. 可讀寫的 BooleanRead/write Boolean.

語法Syntax

運算式ColumnHeadsexpression.ColumnHeads

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

註解Remarks

ColumnHeads 屬性使用下列設定值。The ColumnHeads property uses the following settings.

設定Setting Visual BasicVisual Basic 描述Description
Yes TrueTrue 啟用欄名,並且使用欄位標題、欄位名稱或資料項目的第一個資料列做為欄名或圖表標籤。Column headings are enabled and either field captions, field names, or the first row of data items are used as column headings or chart labels.
No FalseFalse (預設值) 不啟用欄名。(Default) Column headings are not enabled.

對於資料表欄位,您可以在資料表設計檢視的 [欄位屬性] 區段的 [查閱] 索引標籤上設定此屬性,將DisplayControl屬性設定為下拉式方塊或清單方塊。For table fields, you can set this property on the Lookup tab of the Field Properties section of table Design view for fields with the DisplayControl property set to Combo Box or List Box.

RowSourceType 屬性會指定欄位名稱或資料項目的第一列用來建立欄名。The RowSourceType property specifies whether field names or the first row of data items are used to create column headings. 如果 RowSourceType 屬性設定為 [資料表/查詢,可用為欄名的欄位名稱。If the RowSourceType property is set to Table/Query, the field names are used as column headings. 如果欄位標題,則會顯示標題。If the field has a caption, the caption is displayed. 例如,如果清單方塊有三個欄 ( ColumnCount 屬性設為 3) 和 RowSourceType 屬性設為 [資料表/查詢、 第三個欄位名稱 (或標題) 做為標題。For example, if a list box has three columns (the ColumnCount property is set to 3) and the RowSourceType property is set to Table/Query, the first three field names (or captions) are used as headings.

如果 RowSourceType 屬性設為 Value List 時,在 [值] 清單中輸入 (如 RowSource 屬性的設定) 的資料項目的第一列將欄名。If the RowSourceType property is set to Value List, the first row of data items entered in the value list (as the setting of the RowSource property) will be column headings. 例如,如果清單方塊有三個欄, 並且 RowSourceType 屬性設為 Value List RowSource 屬性設定值中的前三個項目可用為欄名。For example, if a list box has three columns and the RowSourceType property is set to Value List, the first three items in the RowSource property setting are used as column headings.

如果您不能在表單檢視中選取清單方塊或下拉式方塊的第一列,檢查 ColumnHeads 屬性是否設定為 [是]。If you can't select the first row of a list box or combo box in Form view, check to see if the ColumnHeads property is set to Yes.

下拉式方塊中的欄名只有在控制項中顯示清單時才會出現。Headings in combo boxes appear only when displaying the list in the control.

支援和意見反應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.