1,105,286 Community Members

Listview

Member Avatar
anJelo.towT
Newbie Poster
1 post since Sep 2013
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

can someone help me ? whenever i start this program its always says that
" compile error
type-declaration characters does not match declared data type.
then the rs.Fields! will go hightlight.
can someone help me ?

    Dim rs As Recordset
Private Sub Form_Load()
Dim list As ListItem
ListView1.ListItems.Clear
Set rs = New Recordset

    getconnected

    rs.Open "Select * From Barrowers", cnn, adOpenDynamic, adLockOptimistic

  Do While Not rs.EOF = True

Set list = ListView1.ListItems.Add(, , rs("Barrowers"))
list.ListItems(list.ListItems.Count).SubItems(1) = rs.Fields!("BarrowersID")
list.ListItems(list.ListItems.Count).SubItems(2) = rs.Fields!("BarrowersName")
list.ListItems(list.ListItems.Count).SubItems(3) = rs.Fields!("BarrowersType")
list.ListItems(list.ListItems.Count).SubItems(4) = rs.Fields!("BarrowersContact")
list.ListItems(list.ListItems.Count).SubItems(5) = rs.Fields!("BarrowersStatus")
rs.MoveNext
Loop
end Sub
Member Avatar
tinstaafl
Postaholic
2,012 posts since Jun 2010
Reputation Points: 559 [?]
Q&As Helped to Solve: 400 [?]
Skill Endorsements: 35 [?]
 
0
 

First off that code looks like VB6 not VB.net.

Try setting the value of the subitems instead of the whole object.

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: