Solved

WRITE CONFLICT IN ACCESS 2000

Posted on 2001-07-05
7
289 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

911 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now