Search code examples
ms-accesstreeviewvba

TreeView populates on its own and crashes Access


My problem is a tree view in my Access 2002 application.

It is already populated, when I open the form. Which is strange, because the only code that adds the nodes is bound to a button.

Also, only part of the data is shown and when I switch between tabs () the data inside the tree view duplicates/doubles. When I then hit any other tab Access crashes instantly just like * zap *

Is it maybe necessary to clean a tree view all along?

Any other ideas what the problem could be - solutions also welcome ;)

Cheers, Ramon


Solution

  • thank you for your suggestions.

    I still did not found out why data is loaded into the TreeView, but I came up with a solution.

    First I started to clean up the TreeView when the form is loaded.
    That really did some good to stability. Now it is possible to click around without crashing Access.

    When data is loaded to the TreeView the old behaviour shows up again. Switching between tabs adds more data and finally crashes Access.

    It seems like the TreeView (Version 6.0) is rebuilding itself without cleaning up properly.
    Based on this assumption, I now clear and rebuild the TreeView when switching to the containing tab.

    I am still interested in the root cause, but its working now.

    Thanks again, Ramon