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

Posted on 2011-10-06
Last Modified: 2012-05-12
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
Question by:ssmith94015
    LVL 61

    Accepted Solution

    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)

    Author Closing Comment

    Worked, simple and effective.
    LVL 61

    Expert Comment

    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.

    Author Comment

    mbizup, that is exactly the scenario that was taking place.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
    Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
    Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
    In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now