Microsoft KB Archive/328828

= How to troubleshoot errors that may occur when you update data in Access queries and in Access forms =

Article ID: 328828

Article Last Modified on 11/24/2004

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition
 * Microsoft Access 2002 Standard Edition
 * Microsoft Office Access 2003

-



This article was previously published under Q328828



Moderate: Requires basic macro, coding, and interoperability skills.

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



SUMMARY
This article describes errors that may occur in Access 2000 when you update data in queries and in forms. This article also describes the causes of the errors and how to troubleshoot those errors.

When you try to update data in a query or in a form, you may receive one of the following error messages:

Operation must use an updatable query.

-or-

This Recordset is not updateable.



Troubleshooting Information About Problems That May Occur When You Update Data in a Query
 When the query is based on three or more tables and there is a many-to-one-to-many relationship, you cannot update the data directly in the query. You can update the data in a form or in a data access page. You can do this based on the query when the RecordsetType property of the form is set to Dynaset (Inconsistent Updates). When the query is a crosstab query, you cannot update the data in the query. When the query is a Microsoft SQL pass-through query, you cannot update the data in the query. When the query is calculating a sum, an average, a count, or other type of total on the values in a field, you cannot update data in the query. Also, you cannot update a query that references a field in the Update To row from a crosstab, a query, a select query, or a subquery that contains totals or aggregate functions. To work around this problem, use the Domain Aggregate function in the Update To row of an update query. You can reference fields from a crosstab query, a select query, or a subquery that contain totals or aggregate functions. When the query is a Union query, you cannot update data in the query. When the Unique Values property of the query is set to Yes, you cannot update data in the query. To work around this problem, set the Unique Values property of the query to No.</li> When the query includes a linked ODBC table with no unique index or a Paradox table without a primary key, you cannot update data in the query. To work around this problem, add a primary key or a unique index to the linked table.</li> When you do not have Update Data permissions for the query or the underlying table, you cannot update data. To resolve this problem, assign permissions to update the data.</li> When the query includes more than one table or one query, and the tables or the queries are not joined by a join line in Design view, you cannot update data in the query. To resolve this problem, you must join the tables correctly so you can update them.</li> When the field that you want to update is a calculated field, you cannot update data in the query.</li> When the field that you try to update is read-only, the database is open as read-only, or the database is located on a read-only drive, you cannot update data in the query. To avoid this problem, do not open the database as read-only. If the database is located on a drive that is read-only, remove the read-only attribute from the drive or move the database to a drive that is not read-only.</li> When the field in the record that you try to update is deleted or is locked by another user, you cannot update data in the query. A locked record can be updated as soon as the record is unlocked.</li> When the query is based on tables with a one-to-many relationship, then the types of fields that you may not be able to modify are as follows: <ul> Join field from the &quot;one&quot; side.</li> The &quot;many&quot; side join field does not appear in the datasheet.</li> Join field from the &quot;many&quot; side after you update data on the &quot;one&quot; side.</li> A blank field from the table on the &quot;one&quot; side of a one-to-many relationship with an outer join exists.</li> The whole unique key of the ODBC table is not the output.</li></ul>

You can resolve any one of these problems if you take the correct action from the following list: <ul> Enable cascading updates between the two tables.</li> Add the join field from the &quot;many&quot; side to your query so you can add new records.</li> Save the record. You can make changes to the &quot;many&quot; side join field.</li> Enter values in fields from the table on the &quot;many&quot; side. You can do this only when the joined field from the &quot;one&quot; side contains a value for that record.</li> <li>Select all primary key fields of the ODBC tables to allow inserts to them.</li></ul> </li></ul>

Troubleshooting Information About Problems That May Occur When You Update Data in a Form
<ul> <li>You cannot update data in a form if the form is based on a stored procedure with more than one table.</li> <li>You cannot update data in a form when you try to update data on a data access page, and one of the following conditions is true: <ul> <li>The data source of the page does not have a primary key, a unique constraint, or a unique index.</li> <li>There is no primary key, no unique constraint, or no unique index in the schema of the page.</li> <li>The page does not have a RECORD NAVIGATION control.</li></ul>

To resolve these problems, take the appropriate action from the following list: <ul> <li>Add a primary key, a unique constraint, or a unique index to the data source of the page.</li> <li>Add a primary key, a unique constraint, or a unique index to the schema of the page.

To add one of these fields to the schema, add a primary key, a unique constraint, or a unique index field to the design of the page. This automatically adds the field to the schema of the page. If you do not want this field to appear on the page, delete it from the page. This permits the field to remain in the schema.</li> <li>Add a RECORD NAVIGATION control to the page.</li></ul> </li> <li>You cannot update data in a form if the form is based on an ActiveX Data Objects (ADO) recordset. Access forms permit you to edit data from an ADO recordset if the ADO recordset is created by using a combination of the MSDataShape and the SQL Server OLEDB providers.</li></ul>

<div class="references_section">