Treeviews are really powerful interface components. I love building with them. They aren't easy to get started with, though, for a few reasons: they can't be bound to data so you have to fill them using VBA code, they're not part of Access and so aren't covered in the Access help (they're ActiveX controls), and they are often used with complex data, such as hierarchical relationships.
I see lots of questions on the web asking "How do I get started with treeviews- is there a tutorial?". My Treeview Project is just that- a tutorial. Seasoned VBA developers may find it goes a little slow, but be patient! It's aimed at folk for whom the Microsoft online references aren't enough. It goes step-by-step, starting with a simple "Hello World" treeview.
Here's the current table of contents.
- My Treeview Project Episode One: The Hello World! Treeview
- My Treeview Project Episode Two: Northwind Categories and Products
- My Treeview Project Episode Three: Changing How the Treeview Looks
- My Treeview Project Episode Four: Expand All and Collapse All Buttons
- My Treeview Project Episode Five: Using The Treeview To Select Records To View And Edit
- My Treeview Project Episode Six: Images for the Nodes
- My Treeview Project Episode Seven : Another Way To Read Through Your Data
7 comments:
What an excellent tutorial. Superb! Easy to follow, useful and descriptive. They don't come any better!
Thanks for sharing this tutorial.
I would like to use a Tree Control to let users choose a record to edit in a form and also to right click on the tree to add a new record.
I can't find any examples of doing the right click, context menu, add record.
Can anyone help ?
I'm attempting to follow your tutorial using Access 2007 and am getting an undefined variable error on 'tvwChild' in the second episode. Any thoughts on how to resolve this error?
MartyO: tvwChild is a constant that you get from the reference to MsComctllib. Access hould have added this reference to your database when you added the treeview to your form.
Your tutorial has been of great assistance to me in creating my first treeview control ... Thanks much.
I'm attempting to set font properties when I build a node. Following your example it seems the syntax should be .font.italic = True. This is in place of your .forecolor=x. Can you point me to documentation on using the font property?
Thanks for any help.
hi i loved your site it is really easy to understand ... i would really like to know how it works using c# cause i am trying so hard but not able to do it ... i have a company's product database in which i need to a have a treeview which can have number of parent nodes and each parent node can have one or more than one child node and even child node can have sub nodes .. and whichever node is selected ,it is to reflected in crystal report..
you are a wise man. Thank's
Post a Comment