PDA

View Full Version : Treeview control programming - add child node at run time



playtex
06-20-2012, 10:07 PM
Hi All,
I have a treeview control(6.0) on 2007 access form that is showing as below in run time.

Legend : A1,B1,E1,K1 are under Ch1 which is under Parent1

Parent1
-----Ch1
---------------A1
---------------B1
---------------E1
---------------K1

Parent2
-----Ch2
---------------A2
---------------C2
---------------F2
---------------N2




Now, if the user enters in a text box as "D1 " and click add, the D1 should be added right exactly in between
B1 and E1 node. Similarly if the user submits "G2" , it should be added between F2 and N2. If "P2" then the node will be added just below N2.



I am looking for VBA code, please help

MacroShadow
06-21-2012, 02:29 AM
Probably not the best way, but you can use the technique shown here (http://www.freevbcode.com/ShowCode.asp?ID=7554).