i added a new check box if a user wants do delete all the records in the list
if not then he choose from the list and hits the delete button
i added a code but if the checkbox is not checked it still deletes all the records from the table
what i am doing wrong?
this is my code
if not then he choose from the list and hits the delete button
i added a code but if the checkbox is not checked it still deletes all the records from the table
what i am doing wrong?
this is my code
Code:
Dim strSQL As String
If MsgBox("Are you sure you want To delete this record\s?", vbExclamation + vbDefaultButton2 + vbYesNo, LsVw.SelectedItem.ListSubItems(3)) = vbNo Then Exit Sub
If Chk.Value Then
CN.Execute "DELETE * FROM TempCash"
Else
strSQL = "DELETE FROM TempCash WHERE TempID= " & LsVw.SelectedItem.Tag
CN.Execute strSQL
MsgBox "deleted successfully", vbInformation
Call Reload
End If