DecimalPlaces Property [Access 2003 VBA Language Reference]
You can use the DecimalPlaces property to specify the number of decimal places Microsoft Access uses to display numbers. Read/write Byte.
expression.DecimalPlaces
expression Required. An expression that returns one of the objects in the Applies To list.
Remarks
The DecimalPlaces property uses the following settings.
Setting | Visual Basic | Description |
---|---|---|
Auto | 255 | (Default) Numbers appear as specified by the Format property setting. |
0 to 15 | 0 to 15 | Digits to the right of the decimal separator appear with the specified number of decimal places; digits to the left of the decimal separator appear as specified by the Format property setting. |
Note You can set this property for text boxes and combo boxes by using the control's property sheet and for table fields by using the table's property sheet . You can also set this property in the Field Properties property sheet in query Design view.
Tip
DecimalPlacesDecimalPlaces
For controls, you can also set this property by using a macro or Visual Basic .
Note The DecimalPlaces property setting has no effect if the Format property is blank or is set to General Number.
The DecimalPlaces property affects only the number of decimal places that display, not how many decimal places are stored. To change the way a number is stored you must change the FieldSize property in table Design view.
You can use the DecimalPlaces property to display numbers differently from the Format property setting or from the way they are stored. For example, the Currency setting of the Format property displays only two decimal places ($5.35). To display Currency numbers with four decimal places (for example, $5.3523), set the DecimalPlaces property to 4.
Applies to | ComboBox Object | TextBox Object
See Also | Comparison of Data Types | Format Property