Treeview -> Count fellow children

Posted on 2005-05-07
Last Modified: 2012-08-14
I know we can return the number of fellow children with


But I need to count the first level of children

Example of treeview

   - son
        - something
   - Daughter
        - something

So if i click Dad, i want to return 2


Dave :-)
Question by:flavo
    LVL 34

    Author Comment

    Found this


    Dim nodX As Node
    Dim lChildNodeCount As Long

    For Each nodX In TreeView1.Nodes
    If Not nodX.Parent Is Nothing Then
    lChildNodeCount = lChildNodeCount + 1
    End If

    LVL 26

    Expert Comment

    Dave? You answering your own questions agani...?

    LVL 1

    Accepted Solution

    PAQd, 250 points refunded.

    Community Support Moderator
    LVL 34

    Author Comment

    The Q's I ask are just tooo easy....

    I was hoping for a property or something... oh well...

    Dave :-)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
    Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
    Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now