ACC2000: Fields with Single Data Type and Currency Format Are Displayed As Double Data Type When Edited (207832)
The information in this article applies to:
This article was previously published under Q207832 Moderate: Requires basic macro, coding, and interoperability skills.
This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).
SYMPTOMS
While you are editing data in a field whose data type is Single and whose
Format property is set to Currency, the data is displayed as a number with the Double data type. As a result, you may see unexpected digits to the right of the decimal point. When you have finished editing and you move the focus away from the field, the data appears in Currency format as expected. This behavior can occur while you are editing data in a Table, a Form, or a Query.
RESOLUTION
Use the following format instead of the built-in Currency format to ensure
that numbers of data type Single are not displayed inappropriately during editing:
$#,##0.00;($#,##0.00);$0.00
To apply this workaround on a form, follow these steps:
- Open any database.
- Create a new table with the following field:
Field Name: TestSingle
Data Type: Number
Field Size: Single
- Save the table as tblSingle, open the table in Datasheet view, and then type the following three records:
TestSingle
0.15
1.23
0.02
- Close the tblSingle table.
- In the Database window, click tblSingle if it is not already selected.
- On the Insert menu, click AutoForm.
- On the View menu, click Design View.
- Click the TestSingle text box, and then on the View menu, click Properties.
- Click the Format tab and set the Format property to the following:
$#,##0.00;($#,##0.00);$0.00 - Save the form as frmSingle.
- Open the frmSingle form in Form view, and then click the
TestSingle field.
Notice that during the editing process, the data in the TestSingle field appears as a number of data type Single instead of a number of data type Double.
REFERENCESFor more information about the Format property, click Microsoft Access Help on the Help menu, type format property in the Office Assistant or the Answer Wizard, and then click Search to view the topic.
For more information about the Fieldsize property, click Microsoft Access Help on the Help menu, type fieldsize property in the Office Assistant or the Answer Wizard, and then click Search to view the topic.
Modification Type: | Major | Last Reviewed: | 6/29/2004 |
---|
Keywords: | kbpending kbprb KB207832 |
---|
|