473,387 Members | 1,483 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Iterating through nodes in a treeview in Ms Access 2003

20
Hi

I am trying to use the Windows treeview in a MS Access application. I want to iterate through child nodes of a particular node but i am failing to figure out how to do it. I have even tried the entire nodes using the following code but am getting an error

For Each objNode In Me.TreeView0.Nodes()

objTree.Nodes.Add objNode.Key, tvwChild, "a" & Genkey, "Define Parameters"
Genkey = Genkey + 1
Next objNode

the error I am getting is runtime error '35606' description control's collection has been modified
Jul 26 '07 #1
1 8528
FishVal
2,653 Expert 2GB
Hi

I am trying to use the Windows treeview in a MS Access application. I want to iterate through child nodes of a particular node but i am failing to figure out how to do it. I have even tried the entire nodes using the following code but am getting an error

For Each objNode In Me.TreeView0.Nodes()

objTree.Nodes.Add objNode.Key, tvwChild, "a" & Genkey, "Define Parameters"
Genkey = Genkey + 1
Next objNode

the error I am getting is runtime error '35606' description control's collection has been modified
Hi, there.

Use Node.Child property to get first child, use Node.Next property to get next siebling. The following code will show all children of selected node.
Expand|Select|Wrap|Line Numbers
  1.     Dim trvTree As MSComctlLib.TreeView, nodCurrent As MSComctlLib.Node
  2.     Dim i As Integer
  3.  
  4.     Set trvTree = Me.trvGroupsTree.Object
  5.     Set nodCurrent = trvTree.SelectedItem.Child
  6.  
  7.     For i = 1 To trvTree.SelectedItem.Children
  8.         Debug.Print nodCurrent.Text
  9.         Set nodCurrent = nodCurrent.Next
  10.     Next i
  11.  
Jul 26 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: alanrn | last post by:
I am using a TreeView to display the hierarchy of a strongly-typed collection (inherited from CollectionBase). The order of the nodes in the TreeView is strictly tied to the order in which they...
3
by: Hrvoje Voda | last post by:
I made my own user treeview control. Now, I can't access the method treeview.Nodes ! Why? Hrcko
4
by: JoKur | last post by:
I'm currently using a context menu to allow the user to add, rename and delete nodes in a treeview control. When a node is added we give it a bogus name ("NewNode") and invoke the add method. We...
0
by: stardust | last post by:
Hi everyone, Within a Winform application, a treeview is contained in a User Control and the User Control is then located within a splitview. When the UserControl added some nodes into the...
3
by: juvi | last post by:
Hi, I have got a problem with Treeview.Nodes.Clear() under VB2005. When I have some nodes in my treeview and a force to clear() all nodes then it seems to work, because the nodes are not visible....
2
by: Kristopher Wragg | last post by:
I'm having some serious problems with the TreeView control. I've got a control that inherits TreeView and has some methods that firstly create a TreeNode then does some recursive procedure to add...
2
by: CraigMuckleston | last post by:
I have a Treeview Control on my Windows Form with a directory structure, ie a list of nodes. This is actually a directory listing from my c drive (similiar to Windows Exlorer). I can iterate...
10
by: John Rogers | last post by:
This code only counts the parent nodes or rootnodes in a treeview, how do you count all the nodes in a treeview? // one way int NodeCounter = 0; foreach (TreeNode currentNode in...
6
Sl1ver
by: Sl1ver | last post by:
I've got a problem, i got the nodes to move but 1. they copy nodes(if you drag it to 3 different places it will actually have 3 of the same nodes) 2. i want to make the nodes, if moved update the...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.