Solved

WRITE CONFLICT IN ACCESS 2000

Posted on 2001-07-05
7
318 Views
Last Modified: 2007-12-19
I am getting a great deal of WRITE CONFLICTS in Microsoft Access ADP database.  Anytime I make a change and do a Me.Requery or a DoCmd.RunCommand acCmdSaveRecord.  I get WRITE CONFLICT Save Record/Copy to Clipboard/Drop Changes.  I am the same user making changes.  I tried using the requery after every update to the record and I still get the error on the Me.Requery.  I am getting tons of these CONFLICTS.  Any suggestions?
0
Comment
Question by:sbornstein
  • 3
  • 2
  • 2
7 Comments
 
LVL 14

Expert Comment

by:mgrattan
ID: 6257128
This can occur if you are using the same table in more than one record source on the form/page.  For example, you're using a query that joins Orders and Customers together in the main form so you can display the customer's name from the Customers table.  Then, in a subform, you are using the Customers table again in order to display the contact information for the customer.  You then make a change to the customer information in the sub-form and you get a write conflict because that customer record is already open in the main form's record source.

This is just a basic example, but it should give you something to check in your form's record sources.
0
 
LVL 4

Expert Comment

by:MacRena
ID: 6265102
sbornstein,
I went through this same maddening problem a few months ago.  And it kicked my butt for a long time, too.

What I had done was added a bit of code in the form's OnCurrent event that put some value into a bound field.  (I was using a DLookup to put the default State Tax from a Preferences table).  The problem was that, by placing a value into a bound field, I was creating a NEW RECORD.  Then when the Me.Refresh (or requery - I don't remember) executed, there was no value in the PrimaryKey field, and Access gave the "WRITE CONFLICT" error, even though I was doing this stand-alone.
See if there is any code that places a value into a bound field from a Form's event and move that code to the PrimaryKey field's OnUpdate event (or some other event that won't execute until the record is created for real).
HTH.
Mac
0
 
LVL 4

Expert Comment

by:MacRena
ID: 6275176
Any luck, sbornstein?
0
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
LVL 14

Expert Comment

by:mgrattan
ID: 6286429
sbornstein,

Please give us an update.  If you need further assistance, you need to provide feedback.
0
 

Author Comment

by:sbornstein
ID: 6290501
Hey MacRena I think you might be onto something sorry for the long delay I was on vacation.  Yes anytime we do a Me.Refresh it seems to cause the conflict.  Any further advice I am looking into that now
0
 
LVL 4

Accepted Solution

by:
MacRena earned 300 total points
ID: 6290555
sbornstein,
Thanks for replying (hope you had a great vacation)

As I stated above (and I don't really have more to add), I got that error when I had some code putting a value into a bound field when a form opened to a new record or after a record was saved and the form went to the EOF (before the next record was actually created).

Look for an event or a control's "Default Value" that  puts a value into a bound field without there being a record actually created.

Mac
0
 

Author Comment

by:sbornstein
ID: 6291795
Well MacRena that was not the exact answer but a good response that got me looking.  I ended up calling a function after anything was being updated that requieried the form and it resolved all the issues for the most part.  So you got the points one thing for earning these I was wondering if you had any ideas.  What I am doing is trapping the conflict when 2 users edit at the same time which is what I want.  But I can get the code to UNDO the changes and then allow the user to select out of the textbox to go onto another record.  Here is what I have so far which fires but keeps firing if the user tries to move after this occurs.

Private Sub Form_Error(DataErr As Integer, Response As Integer)
Select Case DataErr
  Case 3260
     Response = acDataErrContinue
     MsgBox "Record is being edited by another user, please try again later: Err 3260", vbExclamation
     DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
     End
  Case 2757
     Response = acDataErrContinue
     MsgBox "Record is being edited by another user, please try again later: Err 2757", vbExclamation
     DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
     End
Case Else
     Response = acDataErrContinue
     MsgBox "Record is being edited by another user, please try again later:" & DataErr, vbExclamation
     DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
     End
End Select
End Sub
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question