Solved

WRITE CONFLICT IN ACCESS 2000

Posted on 2001-07-05
7
331 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

628 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