Microsoft KB Archive/282377

= ACC2002: Default Value Displayed as #Error in New Record =

Article ID: 282377

Article Last Modified on 11/5/2003

-

APPLIES TO


 * Microsoft Access 2002 Standard Edition

-



This article was previously published under Q282377



Novice: Requires knowledge of the user interface on single-user computers.

This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).



SYMPTOMS
When you open a table in Datasheet view, the New Record line displays &quot;#Error&quot; instead of its default value as expected.



CAUSE
In a Microsoft Access project (.adp), this behavior occurs when the length of the Default value is longer than the Length property of the field. For example, if the default value of a Char(9) field is the word &quot;tenletters,&quot; &quot;#Error&quot; appears in the new record line.

In an Access database (.mdb), this behavior occurs when the length of the Default value of a Text field is longer than the FieldSize property of the field.



RESOLUTION
To display the default value correctly, either change the Length property of the field (FieldSize in an Access database), or type a Default value that is smaller than the length of the field. For example, if the Default value is the string &quot;tenletters&quot; in a Char(9) field, change the Length property of the field to 10.



Steps to Reproduce Behavior
 Open the sample project NorthwindCS.adp.  Create a new table with the following fields:   Name    Type    FieldSize    Other Properties ID     int                  do not allow nulls, primary key DV     char     9           default value: 'tenletters'  Save the table as Table1, and then open it in Datasheet view. Note that the DV field displays &quot;#Error&quot; in the New Record line.

