Link to home
Start Free TrialLog in
Avatar of SE081398
SE081398

asked on

Treeview error "Element not found"

I keep getting this error and I don't know why.  

Dim trvDisplay As Control, imgList As Control
Dim nodObject As Node
   
    Set trvDisplay = Me!Treeview1
    Set imgList = Me!MainMenuImageList
   
    trvDisplay.ImageList = imgList.Object
   
' Initialize Treeview control and add node object representing the categories of examples in the application.
   
With trvDisplay.Nodes
   Set nodObject = .Add(, , "Clients", "Client List", 2)
      set nodObject = .Add("Clients", tvwChild,            "ClientListOption", "Client List", 14, 14)
      Set nodObject = .Add("clients", tvwChild,            "AnniversaryOption", "Anniverseries", 14, 14)
End With

I can set the first child but not the second.  It's the second child that chokes the error "element not found"

What is causing the error?
Avatar of SE081398
SE081398

ASKER

Answer solved.  The cause to the error is due to case sensitivity of the arguments. notice
Add("Clients",
Add("clients",

I found that when I used a capital as in the first it worked fine.

result, the first three arguments must be absolute and unique, including case.
 
ASKER CERTIFIED SOLUTION
Avatar of darinw
darinw

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial