Hello: (I have a ghost in the machine it seems...)
I've developed an Access 2003 front end to a sql server 2000 backend. The main form uses a treeview control which is populated using an adjacency modeled sql table (i.e., EMP_ID, BOSS_ID) called tbl_Dependencies.
The table tbl_Dependencies also has a third field which tracks the sort order of any row item. Thus, the table has three fields: EMP_ID (autonumber), BOSS_ID (INT), and SORT_ORDER (INT).
Below is sample data:
EMP_ID BOSS_ID SORT_ORDER
1 null 0
2 1 0
3 1 10
4 2 0
5 2 10
6 3 0
7 3 10
8 3 20
On the Access main Form, when a person clicks on a node on the tree, a related subform displays the fields from tbl_Dependencies. A user can add/delete records from the subform quite easily; the subform auto-populates the BOSS_ID when adding new records. Whenever a record is added/deleted/changed in the subform, the event triggers a refresh of the treeview wherein the parent node of the record in the subform is selected so that the subform continues to display the subordinate rows.
I've encountered a problem in only one instance where changing the sort order of an item to show up last generates an error 35601 "Element not found". This gets even stranger since this error occurs in only one specific location within the tree. The tree actually has hundreds of rows, some nesting 4 to 5 levels deep. Any other part of the tree can have items added or re-ordered to the end of a list without consequence.
But, for some reason, there is one subsection of the tree where VBA or the treeview cannot "tolerate" changing the sort order of an existing item to be last nor to add a new item to be last. A review of the sql table shows that the data is captured correctly, but the treeview fails to display the relationship.