Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Error updating a field when you add a new record to a form


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

This article applies to a Microsoft Access database (.mdb) or a Microsoft Office Access 2007 database (.accdb), and to a Microsoft Access project (.adp). For a Microsoft Access 2000 version of this article, see
207684 .
For a Microsoft Access 97 version of this article, see
174005 .

↑ Back to the top


Symptoms

When you type data into a new record on a form that is based on a query or an SQL statement, you receive one of the following error messages:
Field cannot be updated.
-or-
Multiple-step operation generated errors. Check each status value.
-or-
Start position is before the beginning or past the end of the rowset. No rows were returned.
When you click OK, you can continue to edit, and then you can save the record.

↑ Back to the top


Cause

This behavior occurs when you try to update a read-only field in a record by using either the DefaultValue property or Visual Basic for Applications.

↑ Back to the top


Resolution

Do not use the DefaultValue property or Visual Basic for Applications to edit read-only controls.

↑ Back to the top


More Information

When you create a form that is based on a query, any control that is bound to a query field that contains an expression is read-only. Because the query expression is not bound to any specific field in the underlying table, you cannot edit the values in these fields. However, when you set the DefaultValue property of such a control, Access tries to write a new value to that control every time that you add a new record.

↑ Back to the top


Steps to Reproduce the Behavior

  1. Start Microsoft Access 2002 or Microsoft Office Access 2003, and then open the sample database Northwind.mdb or the sample project NorthwindCS.adp.
  2. Open the Orders Subform form in Design view.
  3. Click in the Extended Price text box. On the View menu, click Properties, and then set the DefaultValue property to 0 (zero).
  4. Close and save the Orders Subform form.
  5. Open the Orders form in Form view, and then add a new item to any order. Note that you receive one of the error messages that are mentioned in the "Symptoms" section of this article.

↑ Back to the top


Keywords: kbprb, kberrmsg, kbdta, kbaccess10ready, accrtmpublic, kboffice2003yes, kbarttypefix, kbbillprodsweep, kbsweptsoltax, kb, kbvba, kbfreshness2007, kboffice12yes, kbswept

↑ Back to the top

Article Info
Article ID : 289659
Revision : 3
Created on : 4/18/2018
Published on : 4/19/2018
Exists online : False
Views : 201