Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Developer 49 Lessons    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Write Conflict
Michael Albert 
       
11 months ago
I'm in a single user enviroment with no connection to a backend database.

I have a routine where when I update a field an after update event kicks in to update the date the item was changed.

DetailsPrivate Sub StatusComboBtn_AfterUpdate()
    Dim S As String
                  
    S = "UPDATE TPR03aTasks SET TPR03aDateStatChg=#" & Date & "# WHERE TPR03aTskID=" & TPR03aTskID
    'MsgBox S
     DoCmd.SetWarnings False
     DoCmd.RunSQL S
     DoCmd.SetWarnings True
End Sub


When I do this it get a Write Conflict error.
See images on next posting

Michael Albert OP  @Reply  
       
11 months ago

Michael Albert OP  @Reply  
       
11 months ago
If I click "Save Record"  the error msg goes away but the update fails.
On the second attempt if I click "Copy to Clipboard, the eror msg goes away but again it fails.
On the third attempt If I click "Copy to Clipborad"  IT WORKS.

Is this a bug or something?


Mike Albert
Sami Shamma  @Reply  
             
11 months ago
Un-comment the message box on S. And send it to us, please.
Kevin Robertson  @Reply  
          
11 months ago
You are running into a conflict using an UPDATE statement in the After Update event of your Combo Box. Set the date directly in the form.
Donald Blackwell  @Reply  
       
11 months ago
This is a "safety" feature in case 2 or more people are viewing the same record at the same time so that one person doesn't edit it, then the other overwrites what the first one does. In your case, your form has the record open and the vba is trying to edit the record behind it.

Here is a video related to the topic:

https://599cd.com/blog/display-article.asp?ID=1659
Michael Albert OP  @Reply  
       
11 months ago

Michael Albert OP  @Reply  
       
11 months ago
Sami: Here is the MsgBox uncommented.

Donald: I set the Record lock to Edited Record and I don't get the Error message but the update doesn't happen.

Kevin: you asked me to :Set the date directly in the form.  The field I want to update is not on the form.

Mike

Mike

Mike
Sami Shamma  @Reply  
             
11 months ago
Michael, I don't know what's going on, but let's try something else. Keep the warnings on and see if you get an error message.
Michael Albert OP  @Reply  
       
11 months ago
Yes I do Sami.
I'm actually thinking I might move from an After Update event to an On Current event. Change the logic a bit by looking for the Completed Code (3) in the  table and if field "TPR03aDateStatChg" is blank or null, update "TPR03aDateStatChg" Then.  I see what  Kevin is saying and why it's not working now.

Mike
Michael Albert OP  @Reply  
       
11 months ago
Sorry typing error. I meant to say I did that Sami.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Developer 49 Lessons.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 4/13/2026 7:27:38 AM. PLT: 1s