Dim nodX As Node ' create a tree
For intLoop = 1 To rsNav.RecordCount
strName = Trim(rsNav!na_name)
strGroup = Trim(rsNav!na_group)
strGraphic = Trim(rsNav!na_graphic)
'test if it's a top node
If rsNav!na_topnode = True Then
Set nodX = myTree.Nodes.Add(, , strGroup, strName, strGraphic)
Else
Set nodX = myTree.Nodes.Add(strGroup, tvwChild, strName, strName, strGraphic)
'Set nodX = myTree.Nodes.Add(strGroup, tvwChild, strName, strName, strGraphic)
End If
rsNav.MoveNext
Next intLoop
I get an error "Key is not unique in collection" and I know that it is caused by this...
I have a top node called "Contacts" and nodes below that are all of group "con" one of them is "Records"
but I also want to specify "Records" under other nodes ie. top node "Stock" with "Records" under it...
I have tried all sorts of things to get it work but no joy - I have got this working with VFP but the it seems I need a missing ingredient with VB...!
thanks