Search code examples
runtime-errorms-access-2010subform

Access Front MySql Back Runtime Error 7878


RunTime Error The Data has been changed.

I`m having a difficult time with one of my sub-forms. It used to work without complaints but I guess now it decided to be a little verbose. On this form I have a subform that has a variety of checkbox options. Whenever the user enters a checkbox option and then exits to the main form there is an On Exit Event which runs. It combines some textboxes from various forms and then puts that value in a textbox on the main form.

 var1 = [Form1]![Textbox].Value 
 var2 = [Form2]![Textbox].Value 
 var3 = [Form3]![Textbox].Value 

 Me.[TextBox].Value = var1 & var2 & var3

For some reason upon exiting the subform I am getting the Runtime error.

The pattern is not apparent.

  1. I can navigate from the subform to the main form without making any changes in either without receiving an error message.
  2. If I go into the subform, make a change, exit the subform, the textbox will be updated with no complaint, however if I go back into the subform, do not make a change and then go back to the main form, then I get the runtime error
  3. similarly after making sure that behavior 1 is true I can go into the subform, change something come back out, but if I try to go back into the subform and make an additional change I will get a complaint. (I was able to fix this by making an on enter event refresh the subform)

I am unable to get the Runtime Error fixed though... :(


Solution

  • I see that this is an issue for many people with no solution. Here was my work around.

    From my observation the form that was having it's Textbox.value updated is somehow silently updated by either the on enter or on exit of it's subform so when the on exit action of updating that textbox occurs it complains that the main form was updated, thus leaving me to conclude that when that form is updated it is not shown to the user.

    Thus, my work around is to requery the main form on the subform's exit in order to get that new data loaded and changed.

    Caveat!! Requery will by default bring you back to the first record thus presenting the possibility of changing the textbox of the wrong record. Thus as part of the requerying process, if you choose this hack, you will have to bookmark the current open record, requery, and then fetch that record again. I used the code from this webpage in order to achieve the desired effect. Thus circumnavigating the 7878.

    Requery and stay on record: http://www.baldyweb.com/Requery.htm