Need Help - Easy Q - Delete record using VBA

S

SlowGirl

I'm new to VBA and need to delete a record using VBA in an ODBC linked SQL
table. I'm getting the "use dbSeeChanges" error due to an Identity column.
I've done lots of research and I get the concept I should be using a
recordset but most examples are too complicated for my novice brain to
decipher at this point in time.

Would someone be kind and help me (I really need specifics)?
here is my code, as you can see it's simple:

Private Sub cmdCANCEL_Click()

Dim strCancelDistSQL As String

strCancelDistSQL = "DELETE dbo_tblSI_CorrectionDist.* FROM
dbo_tblSI_CorrectionDist WHERE
(dbo_tblSI_CorrectionDist.C_LOG_ID)=[Forms]![frmCorrectionRequest]![C_LOG_ID];"

CurrentDb.Execute strCancelDistSQL
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top