Hierarchical Data, Recursion, Tree-Views, and a Custom Class to Assist

Here is an 80% solution on the Access Item Genie. I will keep adding to this. There is little error checking so it may crash. Also some of the right click menu is not complete (Edit a node, node information, and delete a node are not coded). But most of the basic functionality is there.

AIG.png


Features
-Right click to add Locations or Items
-Can add under an existing node or as a root node
-Click on a location and it shows all items in that location in the subform
-Click on an item and it brings up item details
-Full drag and drop to move locations and items under another location
-Can edit the location name directly in the tree (little finicky you have to click then wait)
-Can edit items or locations by the subforms and will reflect in the tree. Include moving location

If you want to collaborate on this I think it could be a very workable idea. We could start a new thread and continue to add features.

Other features to add.
1. Bulk location adding
2.Bult item adding
3. Provide Location summary information. Could total all items, cost, in a location and all sub locations.
4. reporting
5. Duplicate the right click features to a menu or buttons
6. Aesthetics.

You will need to reselect all of the images will will save the correct path. I will fix that in the future to only save the file name and then you only have to pic the path once.
 

Attachments

That confirms I was on the right track with this. It's getting late so I'll work with it more tomorrow morning.
 
Nice work! Would be great for a bom inventory system.
 
@MsAccessNL,
I built a BOM demo that I thought was very useable for what the OP asked.

However, the OP never responded and no one really seemed interested. It is something I think I would have actually used in a previous job. This allows you to pick generic parts assign to a specific assembly and then make the "as built" list by adding actual part serial numbers.

If interested here it is
In the same video look at 24 minutes in to see how it works.

Here is the original thread

This thread discusses more my table structure for a BOM and my different opinion of how you can structure it.
 

Attachments

Those location icons are hard to work with. I attempted to use some png's converted to bmp's and the transparancy is lost! So the icons have to be set in stone with a particular background. At least I understand how the images are getting assigned the key value now. It is simply the name of the file itself. I didn't catch that the first time looking at it. Anyway, I'm working on additional icons and created a cool genie logo for the form. I added one more field for item details called ItemValue to show the actual value of the item since my truck is no longer worth anything near what i paid for it. So the icons in this version are messed up because of the conversion failure to bmp. What would be nice is to capture all the icons in the folder in the dropdown on the form.
 

Attachments

What would be nice is to capture all the icons in the folder in the dropdown on the form.
Currently I list these manually in a table. This could be automated and show the actual icon. Now when you add a location you choose the name of the icon, but do not get to see it. This could be a pop up subform with the Icon name and image where you pick the icon type for the image. The code to do this already exists because it loads the image list with all the icons at runtime. This could also be modified to load the table with the icon names and paths at runtime. Then you could have a pull down showing the icons. I am slowly adding a lot more features and will repost later.
 
There are really not many typical root locations in a given household, but I guess for other applications this would be nice. I did discover your table of icons, and then it was a simple matter of updating the icon list. So a simple Edit List Form should do the trick.

I'm still working on getting a few more icons in the list. The last conversions were too small, I should have gone with 255x255. How do you manipulate the text size in the tree? It's just too small of a font for me.
 
I am going to make a dedicated thread to this and we can continue to demo features. I already made quite a few updates. I demo where you can can do all the formatting. For now I updated it to 11. But you can color and modify the font. Could have different colors for locations and items.
 

Users who are viewing this thread

Back
Top Bottom