Microsoft KB Archive/207832

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

Article ID: 207832

Article Last Modified on 6/29/2004

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



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.</li> On the View menu, click Design View.</li> Click the TestSingle text box, and then on the View menu, click Properties.</li> Click the Format tab and set the Format property to the following:

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

</li> Save the form as frmSingle.</li> 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.</li></ol>

<div class="moreinformation_section">

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.

<div class="references_section">