daveinchicago
IS-IT--Management
If Not (Me.sfCategory.Form.Recordset.EOF And Me.sfCategory.Form.Recordset.BOF) Then
If MsgBox("Are you sure you want to Delete?", vbYesNo) = vbYes Then
CurrentDb.Execute "Delete from dbo_COMPLIANCE_CATEG " & _
"where ID=" & Me.sfCategory.Form.Recordset.Fields("ID")
Me.sfCategory.Form.Requery
End If
End If
I've got the above code tied to a button in Access 2010. The subform is a SQL Table. When I highlight a row in the subform (SQL Table) and hit the 'delete' button, the row should delete. However, I am getting a
Run-Time error '3265' Item not found in this collection.
When I coded this using local tables it worked perfectly. not sure what I'm doing wrong.
Thanks.
If MsgBox("Are you sure you want to Delete?", vbYesNo) = vbYes Then
CurrentDb.Execute "Delete from dbo_COMPLIANCE_CATEG " & _
"where ID=" & Me.sfCategory.Form.Recordset.Fields("ID")
Me.sfCategory.Form.Requery
End If
End If
I've got the above code tied to a button in Access 2010. The subform is a SQL Table. When I highlight a row in the subform (SQL Table) and hit the 'delete' button, the row should delete. However, I am getting a
Run-Time error '3265' Item not found in this collection.
When I coded this using local tables it worked perfectly. not sure what I'm doing wrong.
Thanks.