Cathii
New member
- Local time
- Today, 15:19
- Joined
- Dec 4, 2006
- Messages
- 4
Hi
I am getting an error:
Could not update; currently locked by another session on this machine
when trying to update a table (Regulation_Text) from another table (Archive_TBL) via a from (Regulation Text)
I have used the following SQL UPDATE qry:
-------------
DoCmd.SetWarnings False
strSQL = "UPDATE Regulation_Text INNER JOIN Archive_TBL ON Regulation_Text.Regulation_Id = Archive_TBL.Regulation_Id " & _
"SET Regulation_Text.Title = [Archive_TBL]![Title], Regulation_Text.Image_1 = [Archive_TBL]![Image_1], " & _
"Regulation_Text.Image_2 = [Archive_TBL]![Image_2], Regulation_Text.Special_Condition = [Archive_TBL]![Special_Condition], " & _
"Regulation_Text.Restricted_Access = [Archive_TBL]![Restricted_Access], Regulation_Text.[Text] = [Archive_TBL]![Text], " & _
"Regulation_Text.Updated_Date = [Archive_TBL]![Updated_Date], Regulation_Text.Updated_By = [Archive_TBL]![Updated_By], " & _
"Regulation_Text.Ref_Id = [Archive_TBL]![Ref_Id], Regulation_Text.Regulation_Type = [Archive_TBL]![Regulation_Type] " & _
"WHERE ((([Regulation_Text]![Regulation_Id]=[Forms]![Regulation Text]![Regulation_Id]) And ([Archive_TBL]![Regulation_Id]=[Forms]![Regulation Text]![Regulation_Id])))"
DoCmd.RunSQL strSQL
'stDocName = "qRevertToPreviousConditions"
'DoCmd.OpenQuery stDocName, acNormal, acEdit
DoCmd.SetWarnings True
--------------------------------
As you can see I have tried to call the query directly but have now commented that out as it produces the same results. As far as I can tell there is no lock on the any table and I am the only user.
Where am I going wrong? Any help very much appreciated.
Thanks
Cathii
I am getting an error:
Could not update; currently locked by another session on this machine
when trying to update a table (Regulation_Text) from another table (Archive_TBL) via a from (Regulation Text)
I have used the following SQL UPDATE qry:
-------------
DoCmd.SetWarnings False
strSQL = "UPDATE Regulation_Text INNER JOIN Archive_TBL ON Regulation_Text.Regulation_Id = Archive_TBL.Regulation_Id " & _
"SET Regulation_Text.Title = [Archive_TBL]![Title], Regulation_Text.Image_1 = [Archive_TBL]![Image_1], " & _
"Regulation_Text.Image_2 = [Archive_TBL]![Image_2], Regulation_Text.Special_Condition = [Archive_TBL]![Special_Condition], " & _
"Regulation_Text.Restricted_Access = [Archive_TBL]![Restricted_Access], Regulation_Text.[Text] = [Archive_TBL]![Text], " & _
"Regulation_Text.Updated_Date = [Archive_TBL]![Updated_Date], Regulation_Text.Updated_By = [Archive_TBL]![Updated_By], " & _
"Regulation_Text.Ref_Id = [Archive_TBL]![Ref_Id], Regulation_Text.Regulation_Type = [Archive_TBL]![Regulation_Type] " & _
"WHERE ((([Regulation_Text]![Regulation_Id]=[Forms]![Regulation Text]![Regulation_Id]) And ([Archive_TBL]![Regulation_Id]=[Forms]![Regulation Text]![Regulation_Id])))"
DoCmd.RunSQL strSQL
'stDocName = "qRevertToPreviousConditions"
'DoCmd.OpenQuery stDocName, acNormal, acEdit
DoCmd.SetWarnings True
--------------------------------
As you can see I have tried to call the query directly but have now commented that out as it produces the same results. As far as I can tell there is no lock on the any table and I am the only user.
Where am I going wrong? Any help very much appreciated.
Thanks
Cathii