can anyone tell me .why i got error object variable or with block variable not set .any help would be greately appreciated.here is
the code what i have written.Kindly find the attachment also.
Private Sub Command3_Click()
Set CON = New ADODB.Connection
If CON.state = adStateOpen Then
' con.Open ("Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=\\asfserver\itp$\Product_tabletest.mdb")
Dim success As Boolean
success = OpenConnection(CON)
If success = False Then
MsgBox ("Cannot open Connection")
End If
Set rs = New ADODB.Recordset
Dim X As Integer
If Not CON Is Nothing Then 'added check to see if con is set to a valid object
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) & "'"
CON.Execute "DELETE from suppliers where sup_name='" & ListView1.ListItems(X).Text & "'"
ListView1.ListItems.Remove X
End If
Next
CON.Close
Set CON = Nothing
Else
MsgBox "Connection not set"
End If
End If
End Sub