have a statement in a vba parent.axcreds.nodes count

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • twinnyfo
    Recognized Expert Moderator Specialist
    • Nov 2011
    • 3653

    #16
    Tom,

    I still think you are approaching this from "the whole thing."

    You need to begin with each small step:

    Recreate the main form
    Add the minimal amount of Code to open and close that form without a hitch.
    Gradually add controls to your form
    Add code for the controls
    Add the TreeView control
    Gradually add parts of the code to add functionality to the TreeView control
    etc.

    I still think this is a referencing problem. Either the control is not declared, set or referenced properly.

    Again, in two minutes, I created a form with a TreeView control, dimmed a TreeView, set that object to the control, and was able to access all properties. Everything is there. I think you're just biting off more than you can chew at one time.

    One step at a time--not many of us here have the time to work through "the whole thing." We are trying to point you toward where to focus your troubleshooting .

    The nature of the error has to do with proper referencing. The code does not understand that the object is a TreeView control. It's that simple. That's the answer. You need to find out why it is not declared that way. I think there may be a module somewhere that is declaring it and setting it so publicly, but the code provided doesn't mention it anywhere. Once that public bit is uncovered, you will find success.

    Comment

    • CD Tom
      Contributor
      • Feb 2009
      • 495

      #17
      One more questions and then I'll continue with the step by stem. Where is the data kept for a tree ctrl or node. That's the part I don't understand. Is this tree ctrl or tree view like a table with columns and rows? and if so can I edit this like a table.

      Comment

      • twinnyfo
        Recognized Expert Moderator Specialist
        • Nov 2011
        • 3653

        #18
        Usually a TreeView is filled "from somewhere." Usually from a Table. The user interacts with the tree view to manipulate the data in the table.

        NB: I have not used TreeView controls, but an object-based language like VBA will treat it like any other object.

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32634

          #19
          First I must congratulate Twinny for showing such patience. Above & beyond in my view.

          As for a TreeView control, like Twinny I've heard of them, and seen themn in action, but I've never got my hands dirty with them at all. Nevertheless, in all the objects I've dealt with in Access that manage data there's a consistency to how the data is specified.

          Forms & Repords have a RecordSource property and Controls have a ControlSource property. Have you looked to see if the TreeView Control has such a property? If so what is it set to, if anything?

          Comment

          • twinnyfo
            Recognized Expert Moderator Specialist
            • Nov 2011
            • 3653

            #20
            TreeViews do not have a record source.

            Comment

            • NeoPa
              Recognized Expert Moderator MVP
              • Oct 2006
              • 32634

              #21
              So it doesn't. Well, that's weird. I'd ask how it gets populated but that might allow the thread to be side-tracked so I won't here.

              Comment

              Working...