Write conflict

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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/
 
Back
Top