ACC2002: Data Access Page Does Not Display Default Values in New Records (282362)
The information in this article applies to:
This article was previously published under Q282362 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 add a new record in a data access page that contains an object with a ControlSource property that is a field with a default value, the default value does not appear in the new record as expected. Additionally, the DefaultValue property is not populated as expected.
CAUSE
The DefaultValue property on the page is an ElementExtension. When you create a data access page in Design view in a Microsoft Access database (.mdb), the default value is copied from the table to the data access page. The field's DefaultValue property that you set in the Design view of the table includes a leading equal sign, similar to the following:
The data access page object extended DefaultValue property adds an equal sign to the table's default value without acknowledging the equal sign that is already there, similar to the following:
This behavior prevents the DefaultValue property from functioning correctly.
This behavior is not the same as when you use the Page Wizard or Autopage: Columnar to create your new page. Under either of those circumstances, the wizard does not create the ElementExtension and copy the default value. Therefore, the DefaultValue property is not populated in the Property Sheet, and default values do not appear in newly created records.
In an Access project (.adp), the default value is not copied to the Data Source Control's ElementExtension. Instead, it is retrieved from the respective Extended property on the Microsoft SQL Server computer. Default values appear as expected when you add a new record in your new page; however, the DefaultValue property is not populated. If you change the DefaultValue property on the page in an .adp file, the ElementExtension is created and overrides the SQL Server extended property.
RESOLUTION
To work around this issue, in an Access database (.mdb), when you add a default value to a field in the table's Design view, do not use a leading equal sign. In the table, the DefaultValue property is parsed correctly, with or without the leading equal sign. The default property ="MyDefault" is equivalent to "MyDefault".
In an Access project (.adp), the default value appears correctly when you create a new record in your page. However, the DefaultValue property appears blank in Design view. If you manually populate the DefaultValue property, the value that is entered overrides the default value stored in SQL Server.
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
Modification Type: | Minor | Last Reviewed: | 9/27/2006 |
---|
Keywords: | kbbug kbnofix KB282362 |
---|
|