943,772 Members | Top Members by Rank

Ad:
Jan 17th, 2009
0

COUNT items in node sub node, childre, ...ecc...

Expand Post »
After the treeview is filled is possible to:

count how may AG-xxxxx are in 8501-xxx, count how may items are in each AG-xxxxx, , count how may items are in each SETT. -xx, ....ecc

and store the result in a var

or

count during the treeview is filling and return the result in a var

in effect i want to count how many items are in each node with "+"...
this is my code to fiull treeview:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. RSSQL2.MoveFirst
  2. Do Until RSSQL2.EOF
  3. sValue = Trim(RSSQL2.Fields("COD_AREA").value)
  4. sKey = "K" & sValue
  5. .Nodes.Add , , sKey, sValue & " - " & Trim(RSSQL2.Fields("DESCRIZIONE")), 1, 1
  6. sValue = "AG. - " & Trim(RSSQL2.Fields("SPORT").value)
  7. 'sSQL = .Nodes.Count
  8. .Nodes.Add sKey, tvwChild, "L" & sValue, sValue & " - " & Trim(RSSQL2.Fields("DESCRIZIONE2")), 1, 2
  9. sKey = "L" & sValue
  10. sValue = "SETT. - " & Trim(RSSQL2.Fields("PROVA3"))
  11. SSQL = .Nodes.Count
  12. .Nodes.Add sKey, tvwChild, "M" & sKey & sValue, sValue, 1, 2
  13. sKey = "M" & sKey & sValue
  14. sValue = "COPE - " & Trim(RSSQL2.Fields("PROVA1"))
  15. .Nodes.Add sKey, tvwChild, "N" & sKey & sValue, sValue, 1, 2
  16. '.Nodes.Item(sKey).EnsureVisible
  17. RSSQL2.MoveNext
  18. 'sSQL = .Nodes.Count
  19. Loop
in this case AREA 8501 contain 68 AG. -xxx
in this case Ag. -0300 contain 17 SETT. -XX
in this case SETT. 00 contain 1 item, in this case SETT. 75 contain 1 item
Attached Thumbnails
Click image for larger version

Name:	Immagine.JPG
Views:	15
Size:	47.9 KB
ID:	8860  
Last edited by Ancient Dragon; Jan 18th, 2009 at 3:00 pm. Reason: add coded tags
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sal21 is offline Offline
22 posts
since Feb 2008
Jan 18th, 2009
0

Re: COUNT items in node sub node, childre, ...ecc...

Try the .Children property
Reputation Points: 40
Solved Threads: 24
Junior Poster
SCBWV is offline Offline
125 posts
since Apr 2007
Jan 18th, 2009
0

Re: COUNT items in node sub node, childre, ...ecc...

Click to Expand / Collapse  Quote originally posted by SCBWV ...
Try the .Children property
tks SCBWV, ....

example about my prob?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sal21 is offline Offline
22 posts
since Feb 2008
Jan 19th, 2009
0

Re: COUNT items in node sub node, childre, ...ecc...

Hi,

Try This :

vb Syntax (Toggle Plain Text)
  1. Dim TNode as Node
  2. Set TNode = Trvw.Nodes("AG. -0300")
  3. 'Note Ag.-300 is the Key of the node
  4. MsgBox TNode.Children

Regards
Veena
Reputation Points: 84
Solved Threads: 140
Posting Shark
QVeen72 is offline Offline
923 posts
since Nov 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Printing a Memo field from MSACCESS
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Winsock problem





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC