none
Record locks problem with query RRS feed

  • Question

  • I have a simple query

    SELECT Tool_Cal_TBL.Tool_ID
    FROM Tool_Cal_TBL
    WHERE (((Tool_Cal_TBL.Tool_ID)=[Forms]![2-ToolCalibrationSummay]![ToolIDToDelete]));

    This query yields the result I expect.  However, when I change it to:

    DELETE Tool_Cal_TBL.Tool_ID
    FROM Tool_Cal_TBL
    WHERE (((Tool_Cal_TBL.Tool_ID)=[Forms]![2-ToolCalibrationSummay]![ToolIDToDelete]));

    It tells me it cannot do it due to a lock violation.  I have tried many things to trouble shoot.  I set the form to No Locks, still didn't work.   I tried to put the desired tool_ID in a unbound field and move to the next record, then change the query to use that fields value, but it still doesn't work.

    What am I doing wrong?

    Wednesday, June 5, 2019 12:25 AM

Answers

  • Tom,

    As usual, thanks for your response.  My form does have a record selector, but I do not see the pencil or the triangle.  There are no other forms open at the same time.  I think I solved it, I compacted and repaired the back end and everything seems to be fine.  I should have done that right away, but didn't.  Sorry about that.

    • Marked as answer by tkosel Sunday, June 9, 2019 10:15 PM
    Friday, June 7, 2019 12:48 AM

All replies

  • Does your form have a RecordSelector? If not, add it. Then observe if the record is dirty (the pencil is showing) or not (triangle). If it is dirty it can probably not be deleted.

    Also look at other forms in the application that are open at the same time.


    -Tom. Microsoft Access MVP

    Wednesday, June 5, 2019 2:06 AM
  • Tom,

    As usual, thanks for your response.  My form does have a record selector, but I do not see the pencil or the triangle.  There are no other forms open at the same time.  I think I solved it, I compacted and repaired the back end and everything seems to be fine.  I should have done that right away, but didn't.  Sorry about that.

    • Marked as answer by tkosel Sunday, June 9, 2019 10:15 PM
    Friday, June 7, 2019 12:48 AM