Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Write Conflict: Access 2002

Status
Not open for further replies.
Dec 5, 2001
44
0
0
US
I am facing this weired problem which I belive wasn't there before. I am developing an Access Project DB.

When I try to add a new record to a form based on multiple tables, I get a "Write Conflict" error:

"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."

And there is NO other user.

I checked the Microsoft Support and it says Service Pack 1 for XP should fix this problem. But this has not happened in my case.

Any help will be appreciated.

Thanks!
 
Did u slove this problem , cuz i'm facing it these days ?
 
This often happens when you try to update a record both on the form and in code. But you'll have to give a LOT more info for a more specific diagnosis than that.

What are you doing?

What do expect to happen?

What is happening?

What code is being run? Or Macros?

Jeremy =============
Jeremy Wallace
Designing, Developing, and Deploying Access Databases Since 1995

Take a look at the Developer's section of the site for some helpful fundamentals.


Remember to reward helpful tips with the stars they deserve.
 
I am experiencing the same problem with write conflict error, I am trying to update a field using the following code placed in the beforeupdate event procedure

Private Sub GripStage5_Implementation_BeforeUpdate(Cancel As Integer)
Forms![Structure Data Input].[GripStage5TotalCost] = [Text63] + [Text66] + [GripStage5 Implementation]
End Sub

GripStage5 control is in a subform of form Structure Data Input

Does anyone know how to eliminate the write conflict error?

Osx

 
Be more specific as to what is [text63]' parent.

Rollie
 
Rollie,

[Text63] and [Text66] are text box calculations based on other bound text boxes in subform [Costs Subform]

[GripStage5 Implementation]is a bound text box on the same subform named [Costs subform] who's parent form is [Structure Data Input]

[GripStage5TotalCost] is a bound text box on the parent form [Structure Data Input]

The write conflict seems to be due to trying to update the [GripStage5TotalCost] field via code instead of directly on the form.

The options presented on the write conflict are;
[Save Record] [Copy to Clipboard] [Drop Changes]
and all is okay if I select Save Record

I just need a workaround so these options are bypassed and the record is saved automatically?

Thanx in advance
Osx
 
Private Sub GripStage5_Implementation_BeforeUpdate(Cancel As Integer)
call docmd.runcommand(accmdsaverecord)
Forms![Structure Data Input].[GripStage5TotalCost] = [Text63] + [Text66] + [GripStage5 Implementation]
End Sub

If I've gotten the syntax right, everything will capitalize once you move off the line. If not, hunt through the help files to nail the syntax and spelling.

Jeremy

==
Jeremy Wallace
AlphaBet City Dataworks
Affordable Development, Professionally Done

Please post in the appropriate forum with a descriptive subject; code and SQL, if referenced; and expected results. See thread181-473997 for more pointers.
 
Jeremy,

Thanx for reply, have tried your code and this time when I get

run-time error '7878' The data has been changed

Any ideas?

Osx
 
I have also tried

Private Sub GripStage5_Implementation_BeforeUpdate(Cancel As Integer)
DoCmd.SetWarnings False
Call DoCmd.RunCommand(acCmdSaveRecord)
Forms![Structure Data Input].[GripStage5TotalCost] = [Text63] + [Text66] + [GripStage5 Implementation]
DoCmd.SetWarnings True
End Sub

but still get the error message?

 
Without going thru all the above, I would only ask

1) did you fix the problem?
2) If not show the code you are using.

It looks to me like you are using the recordset when you should be using a recordsetclone which is a 'scratch' copy of the recordset. Be sure and open and close cleanly or you will get this sort of irratic action with different setups.

rollie@bwsys.net
 
Rollie,

I haven't fixed this yet?

I am using the following code

Private Sub GripStage5_Implementation_BeforeUpdate(Cancel As Integer)
Call DoCmd.RunCommand(acCmdSaveRecord)
Forms![Structure Data Input].[GripStage5TotalCost] = [Text63] + [Text66] + [GripStage5 Implementation]
End Sub

which gives error: run-time error '7878' The data has been changed

and have also tried

Private Sub GripStage5_Implementation_BeforeUpdate(Cancel As Integer)
Forms![Structure Data Input].[GripStage5TotalCost] = [Text63] + [Text66] + [GripStage5 Implementation]
End Sub

which allows the update but when moving to a new record or exiting gives a write conflict with 3 options [Save Record] [Copy to Clipboard] [Drop Changes] - if [Save record] is selected the field updates okay.

I've not used recordsetclone? Is this what I need?

Basically, it seems I cannot send a value directly to field using code without entering it directly into some kind of bound object on my forms.

HElp?

OSx
 
Osx99,

send me your email address and I will send you a small mbd that puts a text box into code.

rollie@bwsys.net
 
I also had a problem of conflict between using form and code for accessing the database using ado. The only solution I came up with is to open the database using code in the formload event of the first form of the project.
The connection object is set as public and is used for each subsequent database access.
When forms are processed I no longer get write or any other conflict.
There is a down side to this method since all testing involving code must be done through the first project form to ensure that there is a connection object.
I would be please to learn of an alternative way of dealing with this issue.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top