Hi, Ankush!
So, if you don't explicit a value for the key when you load your TreeView control, it will return empty if you test.
Take a look:
'TreeView1.Nodes.Add Relative, Relationship, Key, Text, Image, ImageSelected
TreeView1.Nodes.Add , , , "Texto1"
TreeView1.Nodes.Add , , "K01", "Texto2"
If you put the code MsgBox TreeView1.SelectedItem.Key in a button, if user select the first option and click the button, the dialog box shows empty; if the user select the second option and click button again, the dialog box will show "K01".
It means that you aren't filling the key property in your treeview control.
So, I'm thinking in your problem and maybe the key property would help you to code what you want.
If you use the primary key field in this property, you easily select the match option in any other control(s). Don't forget to use a letter at first in the key property - for example, if your primary key is an integer value, you should put "K" and then the primary key value, like TreeView1.Nodes.Add , , "K" & oDados.Fields("YOURPRIMARYKEY").Value, oDados.Fields("TheFieldYouWantUserToSee").Value ...
And, for my information, what property you change to made TreeView multiselectable? In my tests, I can't find this functionality, until I changed to turn checkboxes on...
Regards!
SidneiHi
tv1.selecteditem.key returns nothing but a blank msgbox.
I had already tried it.
Is there any other option?