Write conflict

G

Guest

Hi,

I just created a form, that includes a button, which shall run an UPDATE
command via DoCmd.RunSQL that changes some values in the table. Additionally,
the code on the button's click event also close the current form and opens a
new one.

The code works perfectly, but everytime the user clicks on the button a
messagebox called "Write conflict" (in German) appears that prompts me to
apply the changes, discard them, copy them to the clipboard etc.. My question
is: How can I stop this message from appearing? How can I always apply the
new values?

Best wishes,

Peter
 
T

Tony Toews [MVP]

Peter Schmitz said:
I just created a form, that includes a button, which shall run an UPDATE
command via DoCmd.RunSQL that changes some values in the table. Additionally,
the code on the button's click event also close the current form and opens a
new one.

The code works perfectly, but everytime the user clicks on the button a
messagebox called "Write conflict" (in German) appears that prompts me to
apply the changes, discard them, copy them to the clipboard etc.. My question
is: How can I stop this message from appearing? How can I always apply the
new values?

Are you trying to update the record that you are viewing on the form?
If so add the following line(s) before the SQL Update.

if me.dirty then _
docmd.runcommand accmdsaverecord.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Write Conflict 8
write conflict 4
write conflict 3
Write Conflict 1
write conflict 1
Receiving Write Conflict Error 1
write conflict 2
Can I Suppress Write Conflict Message? 4

Top