Wednesday, April 10, 2013

Number Field Loses Decimals

Microsoft Access


Problem:
A field created in Access (2007) is specified as a number with two decimal places (non currency). When data is entered, it rounds to the nearest whole number. This may still occur with the decimals showing as .00

Solution:
This is not a difficult problem, but can be really frustrating if you do not know the correct combination of field properties. The problem is in the definition of the field. The example below is for a field to hold the
acreage size of a plot of land. These plots can be any size, including fractions of an acre.

With the table in Design View, select the row with the number experiencing the error. Choose Number from the Data Type drop down. Now, in the field properties at the bottom of the screen, select the following from the appropriate dropdown lists as shown in the table and image below:
  1. Field Size: Decimal
  2. Format: General Number or Fixed
  3. Scale: Type the desired number of Decimal Places
  4. Decimal Places: Also type the desired number of Decimal Places
Second Image
(Field Properties)
The real problem occurs when the Scale is left at 0 (zero). This is what limits how many numbers will display to the right of the decimal.

No comments: