i am trying to use 2 things
1.to delete a single customer
2.to delete all customers (if the checkbox is checked)
but when i mark the checkbox and hit the delete button it deletes only 1 customer why?
i tried some code but i dont get it
tnx for any help
salsa31
1.to delete a single customer
2.to delete all customers (if the checkbox is checked)
but when i mark the checkbox and hit the delete button it deletes only 1 customer why?
i tried some code but i dont get it
Code:
Dim StrSql As String
Dim All As Integer
Dim OneByOne As Integer
All = MsgBox("Delete All Customers?", vbExclamation + vbYesNo)
If All = vbYes Then
If ChkDelete.Value = xtpChecked Then
StrSql = "DELETE * from TempCustomers"
CN.Execute StrSql
Call RefreshList
ElseIf ChkDelete.Value = xtpUnchecked Then
OneByOne = MsgBox("Delete Temp Customer?", vbExclamation + vbYesNo)
If OneByOne = vbYes Then
StrSql = "DELETE FROM TempCustomers WHERE ID = " & RplS(LsVw.SelectedItem.Tag)
CN.Execute StrSql
MsgBox "Customer Deleted", vbInformation
Call RefreshList
Else
Call RefreshList
Exit Sub
End If
End If
End If
salsa31