Cannot Delete from Specified Table

BennyLinton

Registered User.
Local time
Yesterday, 20:23
Joined
Feb 21, 2014
Messages
263
I have a database (one of several with basically the same code and table structure) that I'm getting the "Cannot Delete from Specified Table" error. I've placed a breakpoint in my VBA and the string is being built properly with the correct record to delete (picking from a record in a gridview), but still the persistent error... thanks for any help all:

Private Sub cancelLine_Click()

DoCmd.SetWarnings False
Dim intLineIndex As Integer
intLineIndex = Me!cashBatchDetail.Form!indx
strDelLine = "Delete from dbo_cashBatchDetail Where indx = " & intLineIndex
DoCmd.RunSQL strDelLine
Form_cashBatchHeader.Refresh

End Sub

My debugger shows a correctly formatted sql:
""Delete from dbo_cashBatchDetail Where indx = 935"
 
Are there related records preventing the deletion?
On a copy of the table, try deleting the record manually to see if any issues show up.
 
True if I try to delete from the table directly it has the 'delete' option greyed-out in Access. This is an ODBC connected SQL Server table as are all the rest in this database. I can delete from other tables like "dbo_cashBatchMaster" of which "dbo_cashBatchDetail" is indeed a child table. I know of no constraints I have on any of the tables other than records for "dbo_cashBatchDetail" cannot be entered without the "dbo_cashBatchMaster" having a parent record.
 

Users who are viewing this thread

Back
Top Bottom