Avatar of peispud
peispud
Flag for Canada asked on

This record has been changed by another users since

Hi.

I am using Microsoft Access  .........  1 user  .........  continuous form


My form has 15 fields.  There are 3 fields that must have a certain relationship for the record to be correct. 


I have been using the "AfterUpdate" event for the datafields to call on a sub that reads and analyzes all the fields in the current record.  Then, this sub needs to set some flags like [Record is OK]  etc        (in the same record).

Often I get the following error.

So, this isn't working well.   "Me.dirty = false" and variations of record save commands have given me no joy.


I would appreciate your advice on how to make changes to the same record that the form.current record is on.  Is there a better approach?


Thank you.












Microsoft Access

Avatar of undefined
Last Comment
peispud

8/22/2022 - Mon
Dale Fye

The problem is that the current record has not been saved when you jump to the other form, which contains a reference to the same record.  When you set the flag in that 2nd form, you are causing the first form to recognized that the data in is no longer current, which causes the conflict.  
What I would do, rather than trying to update the record in your test form, is pass the value back to the main form and continue processing your code based on the value passed back to it.  You can do this by calling a function which opens up the 2nd form, captures the value of the flag you are trying to set, and then closes the 2nd form and passes the value back to the main form as the return value of the function.

peispud

ASKER
Thank you for your reply.   There may have been a misunderstanding.
 I am not jumping between forms.  See below.       As the user completes an edit of any field, then I would like the flags on the right to be updated immediately (without having move to another record.)  By example, I would like the flags on the right to be updated on the "AfterUpdate" event for the field named [Begin].

John Tsioumpris

Is your back end a 3rd party Database Engine e.g MSSQL,MySQL, ...etc ?
If so you need to add a timestamp column .
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Fabrice Lambert

It looks like you want to perform GUI managment rules instead of record managment rules (update one or more control when conditions are met).
In such case, write event handlers attached to controls.
peispud

ASKER
This is a flat database using Microsoft Access on one computer that would not need a network or internet connection for my application to work.

I am trying to update the error flags as the user enters in a record.  The pic submitted in my 2nd comment shows the records and the flags.
ASKER CERTIFIED SOLUTION
Dale Fye

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Mark Edwards

This is a common problem that happens when you use both an interface (form) and SQL to update data without doing a save in between.  The "other user" is yourself.
Your form wants to push unsaved data from your form to your tables.
Your SQL updates the tables that then want to "bubble-up" the changes to the form...
CRASH!!!
Updates can only go one way at a time.  You must save your form changes before updating with SQL and vice versa.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
peispud

ASKER
Thank you Mark Edwards.

Your comments were very well stated, and  right on the mark!
I was unable to find a way / event  to "save the form",  before executing the SQL update,  so I finally resigned to using another approach.