Article ID: 182762
Article Last Modified on 1/22/2007
APPLIES TO
- Microsoft Access 97 Standard Edition
This article was previously published under Q182762
Moderate: Requires basic macro, coding, and interoperability skills.
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 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:
- Open any database in Microsoft Access 97.
- Create the following table and save it as tblSingle:
tblSingle
----------------------
Field Name: TestSingle
Data Type: Number
Field Size: Single
- Open the table in Datasheet view and enter the following three records:
TestSingle
----------
.15
1.23
.02
Close the tblSingle table.
- In the Database Window, click the tblSingle table if it is not already
selected.
- On the Insert menu, click AutoForm.
- On the View menu, click Design View.
- Select the TestSingle text box. 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 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.
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: KB182762