record saved but getting message another user changed adn do I want to save

I have a form that is bound to an underlying table.  On the form, if the user changes the status from Open to closed, the code also populates and closed date box with today's date. Problemis when I go to close the form, I keep getting the write conflict message - how do I avoid this message as users won't know what it is about.  This is an ACCESS 2003 database form.

 Write Conflict message
Sandra SmithRetiredAsked:
Who is Participating?
 
mbizupConnect With a Mentor Commented:
Where is the code that "populates and closed date box with today's date"?  Is it in the After Update event of the control that changes the status?

Anyhow, Immediately before you run the code that "populates and closed date box with today's date", try saving your record with the following command:

Docmd.Runcommand acCmdSaveRecord

(If that doesn't work, try placing that command after the code)
0
 
Sandra SmithRetiredAuthor Commented:
Worked, simple and effective.
0
 
mbizupCommented:
Briefly, in explanation  - If you have a form where users are manually entering data combined with code that modifies records in the underlying table "behind the scenes", that code is effectively a second user potentially modifying the same record that the user is manually modifying.  You need to carefully manage the timing of record saves so that user 1 (who is modifying data manually) does not interfere with user 2 (aka the code) - which can result in this error.
0
 
Sandra SmithRetiredAuthor Commented:
mbizup, that is exactly the scenario that was taking place.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.