Hi eveyone,
I have been looking into populating a tree-view with folders and files, and have found some great examples for doing this, How ever...I cannot seem to work out how to show files/pictures in a form based on the click event of the tree-view.
I have managed to do an onclick event for the files in the tree-view, but I cannot seem to get the onclick event for folders in a tree-view.
Can anyone show me an example so I can learn some more about the treeview, still a newbie but trying hard to learn
Here is an example which I am working on at the moment, but get the error Object variable Or with block variable not set
Thank you in advance of any answer.
Mark
I have been looking into populating a tree-view with folders and files, and have found some great examples for doing this, How ever...I cannot seem to work out how to show files/pictures in a form based on the click event of the tree-view.
I have managed to do an onclick event for the files in the tree-view, but I cannot seem to get the onclick event for folders in a tree-view.
Can anyone show me an example so I can learn some more about the treeview, still a newbie but trying hard to learn

Here is an example which I am working on at the moment, but get the error Object variable Or with block variable not set
Code:
Private Sub tvw_Click()
Dim tClient As String
Dim tParent As Scripting.folder
Dim fd As Scripting.folder
Dim fNode As MSComctlLib.Node
Dim nFolder As String
Dim fso As New Scripting.FileSystemObject
tClient = Me.Klantnaam
Set tParent = fso.GetFolder(fNode.Key) ' <Object variable Or with block variable not set
For Each fd In tParent.SubFolders
nFolder = fNode.Key & "\" & fd.Name
Next fd
Forms!Addpics!FilePathLbl = nFolder
Call GetImagesTreeview(nFolder, tClient)
End Sub
Thank you in advance of any answer.
Mark
Last edited: