By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 1,707 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

Write conflict error - single user database

P: n/a
I recently added some code to the BeforeUpdate event of a text box on a
form. The code uses the new value in the text box to recalculate some
values in another table, which is shown in a subform on this form.
Since I've added the code, I get a Write Conflict error - "This record
has been changed by another user..." This typically does not happen the
first time I edit this text box after I open the form, but on every
subsequent time.

First, I'm not sure if this error is referring to the text box that I'm
modifying (manually) or to the table that I'm editing programmatically.
Second, I'm the only one using this database so I'm pretty sure it's my
code that's causing it.

I've seen many messages on this forum about this error, but nothing
that seems to resolve it. Has anyone had this or know how to fix it??
Thanks.

Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
That other user that changed things is your code!!

ms-access has no way of knowing that the data was changed by another user,
another program accessing the data, or your code!!

So, the problem is that you have a form that is attached to the data, and
editing has started. You then run some code, and instead of modify the data
in the form, you go and modify the data in the table. At this point, when
the form tries to save data, it checks the table, and realizes that someone
else (or code, or program etc) as changed the data.

I've seen many messages on this forum about this error, but nothing
that seems to resolve it. Has anyone had this or know how to fix it??
Thanks.


The above is a clear, and obvious explain of the problem.

The best solution is to FORCE the forms data to disk BEFORE you run code
that modifies that actual table data (or, change your code to modify the
forms data..and not directly to the table).

So, just go:

me.refresh ' force disk write.

your code that modifies the table goes here:

.....you re done!

Try the above, and post back here if it worked.

Maybe the next person will find this solution to this common problem and see
your answer!!

Good luck...

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com
http://www.members.shaw.ca/AlbertKallal
Nov 13 '05 #2

P: n/a
I wonder if I try this code on the AfterUpdate event instead?? I am
going to experiment and I'll post back with what worked for me. Thanks!

Nov 13 '05 #3

P: n/a
All right, I got it to work! I did have to move this code to the
AfterUpdate event. I added Me.Refresh any place before I start editing
the table. No more error! I hope this helps someone else too.

Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.