| | |
Deleting listview checked data using delete button
![]() |
•
•
Join Date: Dec 2008
Posts: 292
Reputation:
Solved Threads: 1
Can anyone tell me how should i delete listview checked data using
delete button. right now i got error object variable or with block
variable not set.
delete button. right now i got error object variable or with block
variable not set.
Private Sub Command3_Click()
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
Dim x As Integer
For x = ListView1.ListItems.Count To 1 Step -1
If ListView1.ListItems(x).Checked = True Then
con.BeginTranserror.zip
con.Execute "DELETE from Supplier where Supplier_Name='" & ListView1.ListItems(x).SubItems(1) & "'"
ListView1.ListItems.Remove x
con.CommitTrans
End If
Next
con.Close
Set con = Nothing
End Sub•
•
•
•
Can anyone tell me how should i delete listview checked data using
delete button. right now i got error object variable or with block
variable not set.
Private Sub Command3_Click() Dim rs As ADODB.Recordset Set rs = New ADODB.Recordset Dim x As Integer con.BeginTrans For x = ListView1.ListItems.Count To 1 Step -1 If ListView1.ListItems(x).Checked = True Then con.Execute "DELETE from Supplier where Supplier_Name='" & ListView1.ListItems(x).SubItems(1) & "'" ListView1.ListItems.Remove x con.CommitTrans End If Next con.Close Set con = Nothing End Sub
![]() |
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Skin Vista In VB6
- Next Thread: retrieving row with reference of Null value
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






