Just come up with an annoying little problem regarding this when the
original form is closed (destroying the tree in it) it empties my 'global
tree' also
Regards
Nigel
-----Original Message-----
From: Bachmann, Nigel [mailto:nbachmann@...]
Sent: 06 September 2001 14:45
To: 'vbra@yahoogroups.com'
Subject: RE: [VBra] Setting TreeView
As usual I reply to my own question, here's my solution so far - if anyone
can think of a more elegant way........
If global_tv Is Nothing Then
tree_load tv_main
Set global_tv = tv_main
Else
tv_main.Nodes.Clear
For Each nd In global_tv.Nodes
If nd.Parent Is Nothing Then
tv_main.Nodes.Add , , nd.key, nd.Text
Else
tv_main.Nodes.Add nd.Parent.key, tvwChild, nd.key, nd.Text
End If
Next nd
End If
Regards
Nigel
-----Original Message-----
From: Bachmann, Nigel [mailto:nbachmann@...]
Sent: 06 September 2001 13:54
To: 'vbra@yahoogroups.com'
Subject: [VBra] Setting TreeView
I have a complex tree view which is on a number of forms, it takes a while
to populate so I would like to store this information and then 'set'
existing treeview controls to it. Here is a summary of my code:
Public tv as TreeView
Private sub load_form()
if tv is nothing then
load_tree(tv_main)'populates treeview on form
set tv = tv_main ' this appears to work
else
set tv_main = tv ' this falls over
end if
End sub
If I can set tv to tv_main why can't I do the reverse? Any help appreciated
Regards
Nigel
'===========================================================
Archive : http://ReliableAnswers.com/YG/msg?vbra
Files : http://ReliableAnswers.com/YG/files?vbra
Group : http://ReliableAnswers.com/YG/group?vbra
Subscribe : http://ReliableAnswers.com/YG/sub?vbra
Unsubscribe : http://ReliableAnswers.com/YG/unsub?vbra
Attachments : Not Permitted
'===========================================================
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
'===========================================================
Archive : http://ReliableAnswers.com/YG/msg?vbra
Files : http://ReliableAnswers.com/YG/files?vbra
Group : http://ReliableAnswers.com/YG/group?vbra
Subscribe : http://ReliableAnswers.com/YG/sub?vbra
Unsubscribe : http://ReliableAnswers.com/YG/unsub?vbra
Attachments : Not Permitted
'===========================================================
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/