Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

ACC2000: Fields with Single Data Type and Currency Format Are Displayed As Double Data Type When Edited


View products that 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).

↑ Back to the top


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.

↑ Back to the top


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:
  1. Open any database.
  2. Create a new table with the following field:
    Field Name: TestSingle
    Data Type: Number
    Field Size: Single
  3. 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
  4. Close the tblSingle table.
  5. In the Database window, click tblSingle if it is not already selected.
  6. On the Insert menu, click AutoForm.
  7. On the View menu, click Design View.
  8. Click the TestSingle text box, and then on the View menu, click Properties.
  9. Click the Format tab and set the Format property to the following:
    $#,##0.00;($#,##0.00);$0.00
  10. Save the form as frmSingle.
  11. 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.

↑ Back to the top


More information

The decimal precision of the data type Single is 7; the decimal precision of the data type Double is 15.

Steps to Reproduce Behavior

  1. Follow steps 1 through 8 in the "Resolution" section.
  2. Click the Format tab, and then select Currency in the Format list.
  3. Save the form as frmSingle, and then switch to Form view.
  4. Click the TestSingle field.

    Note that the value is displayed as a Double rather than as a Single data type. As a result, you see unexpected digits to the right of the decimal point.

↑ Back to the top


References

For 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.

↑ Back to the top


Keywords: KB207832, kbpending, kbprb

↑ Back to the top

Article Info
Article ID : 207832
Revision : 3
Created on : 6/29/2004
Published on : 6/29/2004
Exists online : False
Views : 279