Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

run-time error '7878': the data has been changed ? 1

Status
Not open for further replies.

taaltio

Programmer
Dec 23, 2003
11
FI
What is going on when I get (Access 2002) error message:

run-time error '7878':
the data has been changed

(The error message sounds to me quite confusing.)

then the VBA debugger shows a line
"
!LastModified.Value = Date
"
If I then continue running the coe, it seems to work ok.
Code:
Private Sub btnCloseForm_Click()
    If (TURVIS_CURRENT_KAYNTI_MODIFIED) Then
        With Forms!afrmKirjPvk!sfrm2Perus
            If IsNull(!LastModified.Value) Then
               !LastModified.Value = Date
            Else
                If Not IsDate(!LastModified.Value) Then
                    !LastModified.Value = Date
                Else
                    If (DateDiff("d", !LastModified.Value, Date) > 0) Then
                        !LastModified.Value = Date
                    End If
                End If
            End If
        End With
    End If
    
    With Me.sfrm2Perus.Form
    If IsNull(Me!ViimKayntiPvm) Then
        Me!ViimKayntiPvm = !TuloAika
    Else
        If (Not IsNull(!TuloAika)) Then
            If (IsDate(!TuloAika)) Then
                If (DateDiff("d", Me!ViimKayntiPvm, !TuloAika) > 0) Then
                   Me!ViimKayntiPvm = !TuloAika
                End If
            End If
        End If
    End If
    End With
    
    DoCmd.Close
End Sub
 
!LastModified.Value = Date
is twice in your code, which on is it?

DougP, MCP, A+
 
This is a complete guessing, but hopefully it might provide something...

I see a reference to something called sfrm2Perus twice, using a naming convention indicating it's a subform.

The reference is made in two different ways, one of them, is how I like to do it (including the Form keyword, the other without.

If both references to this subform concerns the same subform, try the latter reference, else try adding the Form keyword to the first (I've also experienced some anomalities when referring to a subform on the current form thru Forms!Main!Sub.Form in stead of Me!sub.Form):

[tt]With Forms!afrmKirjPvk!sfrm2Perus.Form[/tt]

There's another thing, the !LastModified, is that a name of a control on the form (and perhaps also a name of a field), then keep in mind that the DAO recordset also has a LastModified property.

So - that's two possible conflicts:
1 - control and field name being the same
2 - using a reserved word - a property of the forms recordsource.

Roy-Vidar
 
LastModified" is here my (badly)named variable. "sfrm"=subform.
Is there any further explanation available about "run-time error '7878'" anywhere? I coud not found any info on that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top