Can anybody tell me why these statement is not working ?. I want to see supplier detail using listview.here is the code what i have written.
Private Sub Form_Load()
Set con = New ADODB.Connection
con.Open ("Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=\\asfserver\itp$\Product_tabletest.mdb")
con.CursorLocation = adUseClient
Dim listitem As listitem
ListView1.View = lvwReport
ListView1.ColumnHeaders.Add , , "Supplier No."
ListView1.ColumnHeaders.Add , , "Supplier Name"
ListView1.ColumnHeaders.Add , , "Contact Person"
StrSql = "Select"
StrSql = StrSql & "[supplier_name],[type],[fax_no],[contact_person]"
StrSql = StrSql & "From [Supplier]"
rs.Open StrSql, con, adOpenDynamic, adLockOptimistic
While (Not (rs.EOF))
Set listitem = ListView1.ListItems.Add(suppliername)
listitem.SubItems(1) = IIf(IsNull(rs!supplier_name), "", rs!supplier_name)
[B] listitem.SubItems(2) = IIf(IsNull(rs!Type), "", rs!Type)
listitem.SubItems(3) = IIf(IsNull(rs!fax_no), "", rs!fax_no)
listitem.SubItems(4) = IIf(IsNull(rs!contact_person), "", rs![/B]contact_person)
Wend
End Sub