Solved

Error Message: Data Has Been Changed

Posted on 2006-06-25
7
1,224 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
ID: 16980292
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
ID: 16980377
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
ID: 16980784
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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
LVL 58

Expert Comment

by:harfang
ID: 16980827
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
ID: 16981280
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
ID: 17008354
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
ID: 17107815
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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

864 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

21 Experts available now in Live!

Get 1:1 Help Now