You receive a write conflict error when you add a record in multi-table view in Access 2002 (295225)
The information in this article applies to:
This article was previously published under Q295225 Moderate: Requires basic macro, coding, and interoperability skills.
This article applies only to a Microsoft Access project (.adp).
SYMPTOMS
When you try to insert a record in a multi-table view, a stored procedure, or a function in a Microsoft Access project (.adp) file, you receive the following error message:
Write Conflict
This record has been changed by another user since you started editing it. If you save the record, you will overwrite the changes the other user made.
Copying the changes to the clipboard will let you look at the values the other user entered, and then paste your changes back in if you decide to make the changes.
When you click Drop Changes in the dialog box, the record disappears. However, the values from the child record in the join are saved with an unexpected foreign key.
CAUSE
This behavior occurs when the following conditions are true: - The primary key field of the primary table in the query is an identity field.
- The query restricts the records that are returned to exclude some records from the primary table.
RESOLUTIONTo resolve this problem, obtain the latest service pack for Microsoft Office XP. For additional information, click the following article number to view the article in the
Microsoft Knowledge Base:
307841 OFFXP: How to Obtain the Latest Office XP Service Pack
There are two additional resolutions for this problem.
Use a Linked Main Form and Subform
The recommended solution for this problem is to use a linked main form and subform to enter data into the related tables. This allows you to enter records into both tables from one location without using a query, and without having to modify the structure of the underlying tables. To create a main form with a linked subform, follow these steps:
- Create a new form that is based on the related (child) table that is used in the query and include all fields on the form.
- Save the form, and then close it.
- Create a new form that is based on the primary table that is used in the query and include all fields on the form.
- In the Database window, drag the form that you saved in step 2 onto the main form to create a subform.
- View the properties of the subform and set its LinkChildFields and LinkMasterFields properties to the name of the field or fields that are used to link the tables.
Remove the Identity Attribute from the Primary Table
A second solution to this problem is to set the Identity property of the primary key in the primary table to No. This prevents the error from occurring when you enter data directly into the query; however, you will have to manually enter the primary key and foreign key values directly into the query when you insert records. To set the Identity property of the field to No, follow these steps:
- Open the primary table in Design view.
- Click on the primary key field to view its properties.
- Set the Identity property of the field to No.
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in Microsoft Office XP Service Pack 1.
Modification Type: | Minor | Last Reviewed: | 8/13/2004 |
---|
Keywords: | kbprb kberrmsg kbOfficeXPsp1Fix KB295225 |
---|
|