Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Error Message: Data Has Been Changed

Posted on 2006-06-25
7
Medium Priority
?
1,237 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 375 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
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

972 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