This article was previously published under Q207471
Novice: Requires knowledge of the user interface on single-user computers.
This article applies only to a Microsoft Access database (.mdb).
↑ Back to the top
If you type a value into a field whose data type is Single, and that value
is greater than what the Single data type allows, you do not receive a
warning message. Instead, Microsoft Access automatically replaces the value that you typed with the largest possible value allowed by the data type.
↑ Back to the top
This behavior is caused by a rounding error that can occur when a decimal
fraction does not have an exact binary equivalent.
For additional information about rounding errors, click the article number below
to view the article in the Microsoft Knowledge Base:
210423�
ACC2000: Rounding Errors When You Use Floating-Point Numbers
↑ Back to the top
Create a validation rule if you want a warning to appear when you have
typed a number that is too large or too small for the data type of the
field.
Example of a Validation Rule
- Follow steps 1 and 2 in the "Steps to Reproduce Behavior" section later in this article.
- After setting the format to General Number, set the following properties for the TestSingle field:
Validation rule: Between 3.402823E+38 and -3.402823E+38
Validation text: You have entered a number that is larger than the Field Size setting permits.
↑ Back to the top
The range of a single-precision floating-point number is from -3.402823E38 to -1.401298E-45 for negative values and from 1.401298E-45 to 3.402823E38 for positive values.
Steps to Reproduce Behavior
- Start Microsoft Access, and then open any database.
- Create the following table, and name it tblTestType:
Table: tblTestType
----------------------
Field Name: TestSingle
Data Type: Number
Field Size: Single
Format: General Number
- On the File menu, click Save. In the Save As dialog box, type tblTestType. When you are prompted to create a primary key, click No.
- On the View menu, click Datasheet.
- On the Tools menu, click Options, and then click the Keyboard tab. Under Move After Enter, click Don't Move, and then click OK.
- Type the following number in the first record:
3.4028235E+38
Press ENTER. Note that you receive no message that the number is too
large for this field; however, the "5" is removed without prompting, and the number is changed to the largest number appropriate for the Single data
type. This behavior also occurs if you type the following number:
-3.4028235E+38
However, when you type the following number
3.4028236E+38
you receive the following error message:
The value you entered isn't valid for this field.
For example, you may have entered text in a numeric field or a number that is larger than the FieldSize setting permits.
↑ Back to the top
For more information about the single data type, click Microsoft Visual Basic Help on the Help menu, type single data type in the Office Assistant or the Answer Wizard, and then click Search to view the topic.
For more information about validation rules, click Microsoft Access Help on the Help menu, type validate or restrict data entry in tables in the Office Assistant or the Answer Wizard, and then click Search to view the topic.
↑ Back to the top