I am working on a routine that the user can place a status of Archive....and the record will be inserted into a new table and
the current record deleted. When it runs the delete is giving me error 3218 cant delete current record. How can I get around this.
Actually, at least in v2003, Error 3218 is "Could not update; currently locked." In addition to showing us your current code, are you doing anything else to access/lock the underlying Table?
Also, if you're going to the trouble assigning a Status Value of 'Archived' to the Record, why place in in a second,identical/near identical Table? The pretty much standard way of handling this scenario is to have a single Table and simply query that Table and return Records based on whether or not the Status is 'Archived.'
Here's the code. First I am inserting the record into the archive table, then i am trying to delete the current record...that is where it's failing....
'Step 3: Execute the delete.
strSql = "DELETE FROM Assigned_DDQs WHERE Parent = " & Forms!frmTasksUpdate!txtItem
db.Execute strSql, dbFailOnError
'Step 4: Get user confirmation to commit the change.
strMsg = "Archive " & db.RecordsAffected & " record(s)?"
If MsgBox(strMsg, vbOKCancel + vbQuestion, "Confirm") = vbOK Then
ws.CommitTrans
bInTrans = False
End If
It is working now that I have done a compact and repair.
On another note, my insert is not working. I want to add a numeric value and am getting a syntax error.
How do you code the insert with a numeric.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.