Access VBA Error 7878 The Data Has Been Changed

I have a tabular form which displays re-calculated data.

I have a sub which reports progress to the tabular form.

When I initialize my staging tables and report to the form I get the 7878 error. Obviously this is because the data underlying the form has been deleted but the text box control that is displaying my reporting text is not bound to the underlying data of the form...so why the error?

Does anyone know how I can prevent this from happening?
advlegalsAsked:
Who is Participating?
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Sorry, but again ... What is the record source for the form?

"the tables underlying the tabular form "

Tabular ... you mean one form in datasheet view?

mx
0
 
clarkscottCommented:
You must be sharing information between the 2 forms.  Also, this record source must be changing, or being 'adjusted' prior to the form(s) load.

Scott C
0
 
advlegalsAuthor Commented:
There is only one form. I'm reporting from a sub to the form.

The record source is changing, I'm initializing my staging tables before reporulating and recalculating. This is what is causing the error but I can't seem to even error catch it.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
clarkscottCommented:
further,
One form loads using part of a recordset.  The data is manipulated.  The second form opens, using 'shared' fields, and thus your error.

The parent and subforms do not load together.  Actually, I believe the subform data loads first........

Scott C
0
 
GRayLCommented:
Nothing is obvious to me.  You mention a form with a subform, staging tables and a report.  Anymore detail?
0
 
advlegalsAuthor Commented:
I don't have a sub-form, only one main tabular form.
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Can you post the code (if any) where the error occurs?

mx
0
 
advlegalsAuthor Commented:
Public Sub reportProgress(ByVal strMessage As String)
On Error GoTo Err_reportProgress

Forms!frmTimeMatrix!txtProgress.SetFocus

Forms!frmTimeMatrix!txtProgress.Text = " " & strMessage

Err_reportProgress:
'GoTo report
'Resume Next

I can't even catch this error. If I continue after it breaks the sub routine runs as normal....
0
 
GRayLCommented:
>I have a sub.<  What's a sub?
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
"Obviously this is because the data underlying the form has been deleted"

Meaning ??

What is the record source for the form?

Can you post the SQL?

mx
0
 
advlegalsAuthor Commented:
The error happens after the tables underlying the tabular form have been initialized:

 'initialize staging tables
 dbs.Execute ("Delete from tblTime_Master")
 dbs.Execute ("Delete from tblProfessionalsTime")

When I then try to report subsequent progress to the form I get the 7878 error.
0
 
advlegalsAuthor Commented:
The record source for the form is tblTime_Master.

I'm not viewing the tabular form in datasheet view, I'm using form view, the default view is 'Continuous Form'.

Thanks for your efforts so far.
0
 
scifairCommented:
I had perhaps a similar problem - trying to put text into a textbox using textbox.text = string.  The solution was to check (or keep track) of when the underlying data for the form had changed, then do the following BEFORE the textbox.text was set:
form.refresh  - This updates the form with new underlying data
doevents      - this allows the form to update and or waits.  
textbox.text = string
So, How do you know if the form's uderlying data has changed? I knew when I changed it so no problem for me.  
Perhaps you could also check some form property (i did not investigage this) or you could trap the error 7878 and do the code above then return to do the textbox.text = string statement.
This seems to be a more clear answer to this issue but not directly related.
Hope it helps others
0
 
Happ1marCommented:
I just added a Resume in Error Handling on Message
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.