Write conflict

  • Thread starter Thread starter David Howlett
  • Start date Start date
D

David Howlett

I have a form with a large number of fields on it. When I run an Update
query that changes a lot of the fields that the form uses, I get the
following box on the screen:

Write Conflict
This record has been changed by another used since you started editing it
....

My choices at that point are to:
Save Record
Copy to clipboard
Drop Changes

Is there a way around this?

Again, if I have an open form and I programatically execute a query that
changes fields inside the table that the form uses, I get this box.

My code is:
db.execute("MyUpdateQuery")
me.recalc
me.refresh
 
Hi David,

I can't give you a specific answer without actually seeing what you are doing
but I can tell you where to look and what to do. This is caused by two different
actions making updates to the same record. In your case you probably entered
data in one or more fields or edited the data in one or more fields which places
the record in edit mode. Then you try to run the query that updates the
underlying data in the record which is in edit mode.

The solution is to save the record and refresh the form before the update query
is run.
 
Thanks,

I got the following code to work:

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Me.Refresh
db.Execute "qryUpdateFieldsDisplayedOnMyForm"
Me.Recalc
Me.Refresh
 
Back
Top