Microsoft Knowledge Base Email Alertz

KBAlertz.com: 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). For a Microsoft Access 2000 version of this article, see 207684. When you type data into a new record on a

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]

Search KbAlertz

Advanced Search

Webmasters
Put kbAlertz on your website.
[ Click Here for more! ]





ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
The ad says 3 - but KBAlertz referrals get
** SIX MONTHS FREE **


Bug Tracking Software
For bug tracking software or defect tracking software or issue tracking software, visit Axosoft.


Community Site



We Send hundreds of thousands of emails using ASP.NET Email



Expert Web Design & Graphic Design
Design44.com

ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
The ad says 3 - but KBAlertz referrals get
** SIX MONTHS FREE **




Mentioned In








Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks




Article ID: 289659 - Last Review: April 10, 2007 - Revision: 6.1

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

This article was previously published under Q289659
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  (http://kbalertz.com/Feedback.aspx?kbNumber=207684/EN-US/ ) .
For a Microsoft Access 97 version of this article, see 174005  (http://kbalertz.com/Feedback.aspx?kbNumber=174005/ ) .

On This Page

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.

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.

RESOLUTION

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

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.

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.

APPLIES TO
  • Microsoft Office Access 2007
  • Microsoft Office Access 2003
  • Microsoft Access 2002 Standard Edition
Keywords: 
kbvba kbarttypefix kbdta kberrmsg kbprb KB289659
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate

Be the first to leave feedback, to help others about this knowledge base article.

(Optional) Name

(Optional) Public URL Or Email

Comments
No HTML -- Text Only Please