[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 275
  • Last Modified:

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
0
ssmith94015
Asked:
ssmith94015
  • 2
  • 2
1 Solution
 
mbizupCommented:
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
 
ssmith94015Author 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
 
ssmith94015Author Commented:
mbizup, that is exactly the scenario that was taking place.
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now