Hello,
I have an access DB and I am getting the following error: Run time error'-2147467259 (80004005) Could not Update; currently locked
I think it has to do with accessing the current record, modifying it, and then reverting back to that same record with some sql code to edit it. The VBA is below:
Private Sub ContactID_AfterUpdate()
Dim intContact, curMember As Integer
Dim rst As New ADODB.Recordset
Dim conn As ADODB.Connection
If Me.Form.Recordset.RecordCount > 1 Then
If Me.Form.Recordset.AbsolutePosition = 0 Then
If MsgBox("Do you want to update ALL parcels to this secondary contact?", vbYesNo, "Update All?") = vbYes Then
intContact = Me.ContactID.Value
curMember = Me.MemberID.Value
Set conn = CurrentProject.Connection
rst.Open "UPDATE tbl_Parcels SET tbl_Parcels.ContactID = " & intContact & _
" WHERE MemberID = " & curMember, conn, adOpenDynamic, adLockOptimistic
Set rst = Nothing
Me.Requery
Me.Refresh
End If
End If
End If
End Sub
The part in red is where the debugger is hanging. I also read a thread that said I might be directing it to the wrong library type. Any help is appreciated, I think it is probably something simple that I am missing.