Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2002
    Posts
    36

    Unanswered: How to test if parent node exists?

    How do I test if a parent node of a tree control exists? So far, I can't find a method, function or proerty that works. I always get an error msg saying object does not exist or object required.

    I want to see if a parent node exists, and if so, then set a child of that node. If no, I want to create the parent node and then set the child node.

    Any tips are greatly appreciated.

    J

  2. #2
    Join Date
    Apr 2002
    Location
    Germany
    Posts
    228
    In what language though?
    You should be able to just try to access it and catch the exception if it occours.

  3. #3
    Join Date
    Jul 2002
    Posts
    36
    This is with an ActiveX tree control in VBA. I thought about using error trapping to catch the errors, but thought there might be a method to test if a node exist like:

  4. #4
    Join Date
    Jul 2002
    Posts
    36
    continued...

    a method or function like:

    if nodeExists(myTree.nodes.item("parentid")) then
    'add child
    else
    'add parent
    'add child
    endif

    I don't have much documentation on this control, and all the stuff I got off msdn doesn't say anything about checking to see if a node exists.

    J

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •