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

您可以使用DecimalPlaces屬性來指定 Microsoft Access 會使用顯示數字的小數位數。You can use the DecimalPlaces property to specify the number of decimal places that Microsoft Access uses to display numbers. 可讀寫的 ByteRead/write Byte.

語法Syntax

運算式DecimalPlacesexpression.DecimalPlaces

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

註解Remarks

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

設定Setting Visual BasicVisual Basic 描述Description
自動Auto 255255 (預設值)數字會顯示 Format 屬性設定值所指定。(Default) Numbers appear as specified by the Format property setting.
0 到 150 to 15 0 到 150 to 15 在小數分隔符號的右邊的數字顯示指定的小數位數。Digits to the right of the decimal separator appear with the specified number of decimal places.

在小數分隔符號的左邊的數字會顯示Format屬性設定值所指定。Digits to the left of the decimal separator appear as specified by the Format property setting.

您應該將 DecimalPlaces 屬性設定在資料表的屬性表中。You should set the DecimalPlaces property in the table's property sheet. 您在表單或報表建立繫結的控制項繼承上一中DecimalPlaces屬性設定的欄位中的基礎資料表或查詢,因此您不需要指定個別的每一個您建立的繫結控制項的屬性。A bound control that you create on a form or report inherits the DecimalPlaces property set in the field in the underlying table or query, so you won't have to specify the property individually for every bound control that you create.

如果 Format 屬性空白或設定成 [一般數值 DecimalPlaces 屬性設定會有沒有作用。The DecimalPlaces property setting has no effect if the Format property is blank or is set to General Number.

DecimalPlaces 屬性會影響只顯示的小數位數、 儲存不多少小數位數。The DecimalPlaces property affects only the number of decimal places that display, not how many decimal places are stored. 若要變更數字的儲存方式,您必須變更FieldSize屬性在資料表設計檢視中。To change the way that a number is stored, you must change the FieldSize property in table Design view.

您可以使用DecimalPlaces屬性來顯示以不同方式從Format屬性設定或他們所儲存的方式的數字。You can use the DecimalPlaces property to display numbers differently from the Format property setting or from the way that they are stored. 例如 Format 屬性的貨幣設定會顯示兩個小數位數 ($5.35)。For example, the Currency setting of the Format property displays only two decimal places ($5.35). 若要顯示四個小數位數 (例如 $5.3523) 貨幣數字,將 DecimalPlaces 屬性設定為 4。To display Currency numbers with four decimal places (for example, $5.3523), set the DecimalPlaces property to 4.

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