ACC97: Single w/ Currency Format Displays as Double When Edited

ID: Q182762


The information in this article applies to:


SYMPTOMS

Moderate: Requires basic macro, coding, and interoperability skills.

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 of data type Double. As a result, you may see unexpected values in the 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.


WORKAROUND

Use the following format instead of the built-in Currency format to ensure that numbers of data type Single are not displayed as numbers of data type Double during editing:


   $#,##0.00;($#,##0.00);$0.00 

The following example demonstrates how to use a custom format with a data type Single on a form:
  1. Open any database in Microsoft Access 97.


  2. Create the following table and save it as tblSingle:
    
           tblSingle
           ----------------------
           Field Name: TestSingle
              Data Type: Number
              Field Size: Single 


  3. Open the table in Datasheet view and enter the following three records:
    
           TestSingle
           ----------
            .15
           1.23
            .02 

    Close the tblSingle table.


  4. In the Database Window, click the tblSingle table if it is not already selected.


  5. On the Insert menu, click AutoForm.


  6. On the View menu, click Design View.


  7. Select the TestSingle text box. On the View menu, click Properties.


  8. Click the Format tab and set the Format property to the following:
    
           $#,##0.00;($#,##0.00);$0.00 


  9. Save the form as frmSingle.


  10. Open the frmSingle form in Form view, and edit the data in the TestSingle field. Note 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.



STATUS

Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.


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 - 7 in the "Workaround" section earlier in this article.


  2. Click the Format tab, and then click the Format property box. Select Currency from the drop-down list.


  3. Save the form as frmSingle and switch to Form view.


  4. Try to edit the data in the TestSingle field. Note that the value is displayed as a Double rather than as a Single. As a result, you see unexpected digits to the right of the decimal point.



REFERENCES

For more information about the Format property, search the Help Index for "Format property."

For more information about the precision of number data types, search the Help Index for "FieldSize property."

Additional query words: changes different


Keywords          : 
Version           : WINDOWS:97
Platform          : 
Issue type        : 

Last Reviewed: April 29, 1999