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

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Feb 2008
Posts: 20
Reputation: sal21 is an unknown quantity at this point 
Solved Threads: 0
sal21 sal21 is offline Offline
Newbie Poster

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

 
0
  #1
Jan 17th, 2009
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
Last edited by Ancient Dragon; Jan 18th, 2009 at 3:00 pm. Reason: add coded tags
Attached Thumbnails
Immagine.JPG  
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 102
Reputation: SCBWV is an unknown quantity at this point 
Solved Threads: 14
SCBWV SCBWV is offline Offline
Junior Poster

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

 
0
  #2
Jan 18th, 2009
Try the .Children property
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 20
Reputation: sal21 is an unknown quantity at this point 
Solved Threads: 0
sal21 sal21 is offline Offline
Newbie Poster

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

 
0
  #3
Jan 18th, 2009
Originally Posted by SCBWV View Post
Try the .Children property
tks SCBWV, ....

example about my prob?
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 848
Reputation: QVeen72 is on a distinguished road 
Solved Threads: 120
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Practically a Posting Shark

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

 
0
  #4
Jan 19th, 2009
Hi,

Try This :

  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
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC