Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21237

how to delete a list if a checkbox is check or if not then from selected listview

$
0
0
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
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

tnx for any help
salsa31

Viewing all articles
Browse latest Browse all 21237

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>