Tom,
I'm using Access 2002 Developer. I have two versions of the TreeView control
installed on my system:
1. Microsoft TreeView Control Version 5 (SP2)
2. Microsoft TreeView Control Version 6
The following information relates to Version 6.
How do I access the value that is currently selected? (via vba of
course).
Where form (Me) contains control TreeView1, code in form's code module could
be:
Dim objTV As MSComctlLib.TreeView
Set objTV = Me.TreeView1.Object
With objTV.SelectedItem
MsgBox CStr(.Index) & " " & .Text
End With
And while I'm at it, is there an event raised when you select a node in
the Tree View control?
It appears not. There are 5 events:
On Updated
On Enter
On Exit
On Got Focus
On Lost Focus
Maybe you could grab the selected node when the Lost Focus or Exit event
fires. I don't know when the On Updated event fires.
I was unable to get help on my system for the TreeView control because its
help file, cmctl198.chm, was not installed. (Why? I have no idea.) I was
unable to find or download the help file from Microsoft. (Which was a
nuisance.)
There are a number of articles on the Microsoft website for the TreeView
control. Coding for .NET seems easier to find than coding for VBA.
Eventually, I found a page for:
MSDN
"Help & Support"
"Search the Support Knowledgebase"
"Search Product = Access"
"For = TreeView".
This listed some 26 articles for Access 97 onwards.
I hope you find what you're looking for and have better luck!
Regards
Geoff