Link to home
Start Free TrialLog in
Avatar of Salvia
Salvia

asked on

Run-time error: '7878' The Data Has Changed ???

Run-time error: '7878' The Data Has Changed

Why do I get this error? and How can I fix it? there is no one else in the database and here is the code that causes the conflict

Forms![Personnel]![subformSPONSORS].Form![txtAuthorized_By] = CurrentUser()



here is the entire procedure, I think it might have something to do with a report being opened

    If Not IsNull(DLookup("[Social_Security]", "DRIVINGRECORD", "[Social_Security]='" & Forms!Personnel.txtSSN & "' AND Suspended=True")) Then
        Forms!Personnel.lblSuspended.Visible = True
        MsgBox "Person's driving privaleges have been suspended!"
    Else
        Forms!Personnel.lblSuspended.Visible = False
        If IsNull(Me.VSerial) Then
            Me.VSerial = CreateVSerial(Format$(Date, "yy"), 5)
            Me.Dirty = False
        End If
        Me.Issue_Date = CDate2Julian(Date)
              If IsNull(Forms![Personnel]![subformSPONSORS].Form![txtAuthorized_By]) Then
                    Forms![Personnel]![subformSPONSORS].Form![txtAuthorized_By] = CurrentUser()
              End If
        stDocName = "TempPass"
        DoCmd.OpenReport stDocName, acPreview
    End If
Avatar of joboy
joboy

on what event is this code running?
Do you know which line of code is causing the error? (it should be highlighted after you click the Debug option in the error dialogue)
Avatar of Salvia

ASKER

I wrote above:

Why do I get this error? and How can I fix it? there is no one else in the database and here is the code that causes the conflict

Forms![Personnel]![subformSPONSORS].Form![txtAuthorized_By] = CurrentUser()




and then below I wrote the whole procedure if you look in it you will find this same line

and it is on the print preview button of a report
Avatar of Salvia

ASKER

I figured it out

PLease delete this question

The problem is that there is 2 forms with the same record source open at the same time

even know they were different fields on each subform 1 subform was manipulating the other subform when the print button was pressed and this caused a data changed error I was able to work around this

by instead of it being
Forms![Personnel]![subformSPONSORS].Form![txtAuthorized_By] = CurrentUser()

I put

Me.[Authorized_By] = CurrentUser()
Forms!Applicants.refresh

to cause the other form to dispaly the same data
Avatar of Salvia

ASKER

PLEASE DELETE!!!
ASKER CERTIFIED SOLUTION
Avatar of GPrentice00
GPrentice00

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial