Error 7878 (data has been changed)

Joined
Sep 7, 2008
Messages
1
Reaction score
0
Hi all, I'm having this problem with error 7878, which from other posts I have seen would be an error occuring when 2 users edit the same data at the same time. However, I'm currently developping so I am the only one in the database, always. I'm trying to send the value of the primary key in some form to a parent form which will receive it in a foreign key field. On my first described form, when I click a button, it closes the form and send in a global variant the value of the textbox representing the primary key, so the other form can receive it.

It works great, unless I edit data in the first form and exit the form without firstly clicking the record selector control to save the modified data (generates error 7878). I got desperate and tried various things to force access to save the current record before closing the form, but the error persists.

I have tried including in my close button click's event procedure combinations of all the following, but the error still persists
frown.gif
:
DoCmd.Save
RunCommand acCmdSaveRecord
Me.Requery
Me.Refresh
DbEngine.Idle dbRefreshCache
Sleep(1000)

From what I understand, the saving of the record really happens (one would hope, after calling so many kind of save functions) but it "happens" only after the button's event is finished... But since the form closes in the button's click, the data is "being saved but not really completed". If I can be clearer, I think that the form's record is only saved once all user-functions stack are done and that the focus is sent back to the form, or so...

I suppose it works this way, and I wanted to know if there's a kind of method to pause the execution of the current event and force the refreshing of the form (like a multi-threaded app would wait until one process is completely finished before continuing another task), so that the form would really get to "Me.Dirty = False" state before the form closes, avoiding error 7878.

I've heard multithreading in access is impossible, but I don't believe it, since I have seen a user progressbar control (wish I had the code -_-) that does a loop of actions and increments the progressbar's filling to the right and we can see it filling slowly to the end. I believe that means that there IS a way to update the form even if code is still running in background.

Hope all is clear, thanks in advance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top