Can someone point to the latest database with the latest features mentioned in this thread? There seems to be a lot of conversation and additional code, but I haven't found the authoritative file with latest info.
MajP, you've done a lot of great work on this !!
The three files at the beginning should now all be current. V18 is the complete demo with various methods of loading. This includes a single recursive table, a union table of non recursive data, a light load, and the full demo employing drag drop and loading images on the fly. I saw that the JKP MS Forms demo was called light load, but that was incorrect. I am working that now with @Pac-Man.
I'm new here, first I would like to thank you for this important contribution that helped me alot,
I'm working on an old data form that fetch its categorization entries from 3 or more levels from a nested table that is being edited and managed by an old form .mdb, I used to use treeview control with much of vb6 coding , that I was not able to maintain for long time ,
but now I see your solution is nearly giving me all what I need to reuse the old data structure,
I just had 2 issues ,
am writing node description in Arabic , while all Arabic characters are already working file in access components , but it gives me ??? and rubbish characters inside the ttreeview control itself , I didn't find a solution for this online.
The second issue :
Is it possible to guide me on how to simply link the form to my nested table , that contains ID , patent ID , Node description.
What should the level mean in your tree table?! Is it something that I should insert while editing?! Or is it something that is already being generated by code from your program!
am writing node description in Arabic , while all Arabic characters are already working file in access components , but it gives me ??? and rubbish characters inside the ttreeview control itself , I didn't find a solution for this online.
The way I tried to make this work for everyone so they do not have to write specific code is building a standard query. If you can build the query you can instantiate and load the treeview in a single line of code.
Need to make a query with Fields Aliased to these names: •Identifier – Something that tells which table the record is from so if it comes from a Union query. This can be the name of the table.
Important with organized data coming from two tables (EMP10 and CUST10) •ID – Concatenate an Identifier with the actual PK •ParentID – Concatenate the parent Identifier with the parent PK •NodeText – What you want to display. Often concatenated data •Image – Optional if using an icon. This is the key used by the Imagelist
I use something called "Identifier" which is needed if the query uses a Union query. It is not really used if the table is self referencing, but required any ways.
If your query is based on a single table that is selfrefencing you can pick anything. If it is based on a union query I would pick the table name for each of the seperate queries that you union together.
Lets assume your table is about employees you could pick something like "emp" as your identifier. Any string would work.
Then you make your query like
SQL:
SELECT "emp"
AS
Identifier,
"emp" & [ID]
AS ID,
"emp" & [Parent ID]
AS ParentID,
NodeDescription as
NodeText
FROM employees
ORDER BY [emp] & [ID];
In this example if your table has no parent for your top most base nodes, then you initialize like this.
I never name my ID fields "ID" in my tables. So I am not sure if you will run into a problem when trying to alias the ID to ID. I recommend changing the name of the ID field in your table to something more descriptive.
If you can send your table or a small sample of it I can quickly test it and see if I can make it display. I can also show how to load. It is as simple as building the query correctly.
I discuss a second treeview control using MSFORMS controls. I can see if that will display arabic.