Solved

Error Message: Data Has Been Changed

Posted on 2006-06-25
7
1,222 Views
Last Modified: 2012-08-13
Hi,
In have a form with a couple of subforms and a combo box that selects records.
There is a fair amount going on on the form but it was working perfectly (or seemed to).
Now I get an error message after making a few selections from the combo box. I can't seem to track down were it is coming from.

The message reads:
The data has been changed.
Another user edited this Record and saved the Changes before you attempted to save your changes.
Re-edit the record.

Any thoughts before I start tearing it apart?

Jim

 
0
Comment
Question by:JimK31
  • 3
  • 3
7 Comments
 
LVL 38

Expert Comment

by:puppydogbuddy
Comment Utility
Try changing the default refresh rate.  The combo box may not be refreshing fast enough between selections.

To change the refresh rate go to Tools > Options > Advanced and change the "Refresh Interval (sec)" value to just 1 or 2 seconds.

0
 

Author Comment

by:JimK31
Comment Utility
I did as you suggested and it did have a positive effect. If I moved real fast I could get it to do it again, but it was pretty good. I have a few questions.

- it was set at 60 secs. That is a big change. Is there a downside to this setting?
- this app gets distributed, does that setting go with the app or is it PC specific?
- this is an big app with many other places with lots of combos do lots of things. This has never happen before, is there a particular function that may be at fault here?

Thanks
Jim
0
 
LVL 38

Accepted Solution

by:
puppydogbuddy earned 125 total points
Comment Utility
Set the refresh interval back to wha it was...it is irrelvant because I used it to confirm a diagnosis...not as a solution....since you did not go into specifics regards to your form and subforms.  Knowing that the refresh interval had a positive effect, tells me that the underlying cause of your problem is probably due to the fact that you have two bound subforms, each of which has edit capability on the same record at the same time. The conflict occurs when (1) there changes entered into the first subform which have not been saved to the underlying table before the second subform is opened for editing on the same record. (2) there are changes to the underlying table that have not been refreshed to the first opened subform at  the time the second subform is opened.

What can you do? There are a few things....first, try placing this code in the onDirty event of each subform and let me know if it worked.

                   Me.Dirty = False

This commits form changes immediately.
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 58

Expert Comment

by:harfang
Comment Utility
Hello JimK31

I do not totally aggree with PDB on this one. Normally, the "dirty" event fires as soon as you start moifying a record. Simply setting Me.Dirty = False each and every time does not seem to be the best  path.

However, the recommendation holds, but only at the various points where you are likely to chnage the data through code The error message in fact  tells you that you are changing the same record from two different places at  the same time. Identify that place and issue a "Me.Dirty = False" right before you get there, and you should be all right.

(°v°)
0
 
LVL 38

Expert Comment

by:puppydogbuddy
Comment Utility
Hi JimK/Harfang,
I agree with Harfang's recommendation on placement of Me.Dirty = False.  I would, however, change the syntax slightly as follows:

         If Me.Dirty then
                Me.Dirty = False
         End If
0
 

Author Comment

by:JimK31
Comment Utility
Sorry Guys, I was out of town. You nailed my setup. I do have two sub forms that have edit capability. I plan on looking at the suggestions made here today and will report back. Soory for the delay.
0
 

Author Comment

by:JimK31
Comment Utility
Did not mean to keep this open so long.
Basically, after hearing what everyone was saying, I went back to the design of this form and removed several of the subforms. I think I just over did it. I did not test Me.Dirty=False, so I can not comment on that.
Thanks for the help.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

744 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

8 Experts available now in Live!

Get 1:1 Help Now