Private Sub cmddelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmddelete.Click
If Not acsconn.State = ConnectionState.Open Then
acsconn.Open()
End If
'sql statements
strSQL = "DELECT * FROM Table1 ([Item Code], [Item], [Sale Price], [Purchase Price]) values ('" _
& txtid.Text & "','" _
& txtname.Text & "','" _
& txtaddress.Text & "','" _
& txtage.Text & "')"
Dim acscmd As New Data.OleDb.OleDbCommand ' the oledbcommand
acscmd.CommandText = strSQL 'sets the sql string
acscmd.Connection = acsconn 'sets the connection to use the oledbcommand
acscmd.ExecuteNonQuery() ' execute oledb commands non query only
acscmd.Dispose()
MsgBox("deleted")
acsconn.Close()
End Sub