Evening experts,

I have a form in Word with a Treeview. I also have an Excel sheet with two columns containing a Task No field (unique) and a Description field.

The Task No field contains a hierarchy of numbers e.g. 1, 1.1, 1.1.1, 1.2, 1.2.1, 1.2.1.1 etc;

I have a table in a database that contains the parent numbers e.g. 1, 2, 3 etc; and the corresponding Descriptions.

I am populating the treeview without any issues with the parent numbers from the database table.

What I want to do, and I am having great difficulty in achieving this, is to loop through a recordset returned from the Excel sheet and create a parent/child relationship like this:

1
1.1
1.1.1
1.1.1.1
1.1.1.2
1.2
1.2.1
2
2.1
2.1.1

I am sure you get the picture. There will be a maximum of 7 levels allowed e.g. 1.1.1.1.1.1.1

The key for the node is the Task No (but Treeview doesn't seem to like this so I am appending an 'a' to the end) and the node text is the Task No-Description e.g. 1.1-Description Text.

I can add nodes and save them back to the Excel sheet, it is just the parent/child thing that is causing me a headache and any hints would be greatly appreciated.