Solved

How do I Resolve the "Data has Been Changed" Error

Posted on 2013-05-30
6
361 Views
Last Modified: 2013-06-03
I have created a form (see attached) where the user can input data from a spreadsheet into the appropriate table based on the option button selected.

The problem I am facing is that when the user selects any of the option buttons and does the import for the first time, it works fine. However, when they try to do it again with a different button, the error, "The Data Has Been Changed, Another User Edited This Record...".

It still works, but I do not want this message to keep popping up and am not sure how to resolve it.
Form-Error.jpg
0
Comment
Question by:geeta_m9
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 250 total points
ID: 39208539
Without seeing your code it's hard to provide suggestions, but in general it's a good idea to do this before those types of operation:

If Me.Dirty Then Me.Dirty = False

This forces Access to save any changes, which can sometimes avoid that error.

You'll also get this error if you're trying to manipulate data in the records that are on the form, if those are dirty. In general you should either (a) perform all data manipulations in code or (b) perform all data manipulations through the form.

But again, without seeing the code it's hard to advise ....
0
 
LVL 57

Assisted Solution

by:Jim Dettman (Microsoft MVP/ EE MVE)
Jim Dettman (Microsoft MVP/ EE MVE) earned 250 total points
ID: 39208545
You use the forms OnError event to check the errors and respond.

Two variables are passed in by Access; ErrNum and response.

Errnum is the error that the form encountered.

You set Response to tell Access what to do, which is either act normally (pop up a error message) or just continue (you will put up your own message).

Jim.
0
 

Author Comment

by:geeta_m9
ID: 39208554
Where would I put the code?
0
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 

Author Comment

by:geeta_m9
ID: 39208564
I am attaching two files. One is the form that has the option buttons and the other is the code in the module that it calls.
Form--Code.txt
Module-Code.txt
0
 
LVL 57
ID: 39208682
Hard to say.  Open the form and in the OnError event, place a STOP.

Then give it a go.   If you hit the stop, then the error is occuring in the form.

 If not, then it's in either one of your GetData... procedures or GetDataFromSpreadsheet().   Without any error handling (which you should add), there's no way to tell.

Jim.
0
 

Author Comment

by:geeta_m9
ID: 39216486
With your help, I managed to stop the error from popping up. On the "On Error" event of the form, I inserted the following code:

If DataErr = 7878 Then
        Me.Dirty = False
        Response = acDataErrContinue
End If
0

Featured Post

Independent Software Vendors: 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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

739 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