Showing posts with label Treeview. Show all posts
Showing posts with label Treeview. Show all posts

Sunday, September 4, 2011

Is the treeview control going away?

You may have noticed I haven't posted in a while. I have not been working in VBA/MS Access and have neglected the blog. But I'm still here....

I was doing some reading today and noticed that we now are given to expect that the treeview control is not supported in the 64-bit version of Access 2010. Sounds like most folk should be installing the 32-bit version and so will continue to have access to the treeview. There's a long discussion of this on UtterAccess here.

There's always been a healthy discussion on the merits of using ActiveX controls and other elements fro outside Access in Access applications. It has always been understood that long time support for these controls was not guaranteed, and that using them could make deploying and managing your application more complex.

Sounds like for now running the 32-bit version of Access should keep your treeview running well. #

Tuesday, November 17, 2009

My Treeview Project Episode 7 | Another Way To Read Through Your Data

In Episode 7 of My Treeview Project we're going to look at another approach to reading through our data and adding nodes to the treeview.

Tuesday, September 8, 2009

Treeview Example- Filling Recursively, Populating With Names of Folders

Here's another working Treeview example from the code archive at UtterAccess.

Quote: This little database illustrates the implementation of Microsoft Knowledge Base Article Q20981 (How to Fill a Treeview Control Recursively). In addition, frmFolderExamples illustrates one way to fill the Treeview Control with the names of the folders located on a drive. It also shows how to return some of the properties of the treeview nodes as well as how to clear a treeview. I use some code harvested from Candace Tripp’s Browse and Open Files Database as well as ideas from Luiz Cláudio’s Treeview Control for Database Objects.

Friday, September 4, 2009

Using Right-Click With Treeview Nodes

Lets say you have a treeview and you want a user to be able to right-click a node and then be able to either delete it, copy it, or view details about it. How do you trap the right-click event? How do you show a context menu? And how do you know what node was clicked?

There's no OnRightClick event for Treeviews- that would have been the easiest solution. There are MouseUp and MouseDown events that know what mouse button was pushed- maybe that would help.

It turns out the secret is MouseUp.

Tuesday, March 17, 2009

My Treeview Project | Episode 6: Images for the Nodes

This (at long last) is Episode 6 of My Treeview Project.

  • In Episode 1 we started with the "Hello World" treeview
  • In Episode 2 we built a treeview that showed some simple data from the Northwind Traders sample data
  • In Episode 3 we learned how to change the appearance of the treeview
  • In Episode 4 we added Expand All and Collapse All buttons that interact with the treeview
  • And in Epsiode 5 we finally got the treeview to do something useful- we used it to select records to view and edit.

Here's this episode's treeview:

Download the finished database
In Episode 6 you'll see two things. The main focus of the episode is the use of images for the nodes in the treeview. As well, I'll demonstrate a different approach to the code that reads records from the tables and creates the nodes.

Monday, March 16, 2009

Access TreeView-ListView Basics from Database Journal

Here's a treeview article I haven't run across before: Access TreeView-ListView Basics from Database Journal walks the reader through creation of a form with a treeview and a listview.

It doesn't have a detailed explanation of how it works, but it does include a downloadable working example, and the zip file for the example includes the elusive help file that covers the treeview and listview controls- very handy! The code uses the "one pass" approach to loading the treeview- a single query is used that brings in all books, and whenever a new bookstore is encountered that node is added.

Sunday, September 14, 2008

My Treeview Project | Episode Five: Using The Treeview To Select Records to View/Edit

In episode 5 we'll make the treeview really do domething. We'll use it to select records from the products and categories tables that we want to see or edit. The work you'll have to do in this episode is a little more than in the last two, but we'll go through it step-by-step. We're building on the work you've done in previous episodes.

Saturday, March 29, 2008

My Treeview Project | Episode Four: Expand All and Collapse All Buttons

In episode 4 we'll take the treeview we designed in episode 3 and add buttons for "collapse all" and "expand all". This will let us get started working with the nodes in a treeview.

In previous episodes I told you to make sure you'd built the treeview from the last episode so we could add to it. This time you can download the completed treeview including this episode.

Thursday, March 13, 2008

My Treeview Project

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.

Tuesday, March 11, 2008

My Treeview Project | Episode Three: Changing How the Treeview Looks

Here's what we'll end up with
after this episode.

In Episode 1: The Hello World! Treeview we built the simplest of treeviews, just to introduce some of the concepts. In Episode 2: Northwind Categories and Products we created a treeview that displayed products in categories based on data from the Northwind sample database.

In this episode we'll take the treeview from epsiode 2 and add some tweaks that affect how it looks. This will let us look at a number of useful techniques and concepts. If you haven't done episode 2 you should go back to it now and build the database because you'll be working from there in this episode.

Sunday, February 24, 2008

My Treeview Project | Episode Two: Northwind Categories and Products

In Episode 1: The Hello World! Treeview we built the simplest of treeviews, just to introduce some of the concepts. In this episode we'll build a treeview to display products in categories.

We'll use data from Microsoft's Northwind Traders sample database. If you don't have a copy you can download it here .

Start by creating a blank form in the Northwind Traders database and add a Treeview control, the same way we did in episode 1.

Thursday, February 21, 2008

Another Treeview Reference from Microsoft

I stumbled across this post on MSDN this morning. It gives a great overview of the treeview control that I hadn't seen before.

See also: other treeview posts on my blog.

Thursday, February 14, 2008

My Treeview Project | Episode One: The Hello World! Treeview

The hello world program is a common first exercise when learning to work in a new programming environment: a program that simply displays or prints "Hello World!". In the first episode of this new series on treeviews we'll build the hello world treeview in an Access form.

Wednesday, February 13, 2008

A Working Treeview Example with Drag and Drop

Here's another working treeview sample from UtterAccess.com. This one's pretty sophisticated, with a drag and drop function used to change who staff report to and another to drag unassigned orders from a listview into the treeview where you drop them on the staff that will work on them. A nice implementation indeed.
The author, Brent Spaulding, is one the the treeview experts at UtterAccess.
See also: other treeview posts on my blog.

Monday, February 11, 2008

Using a TreeView Control as a Record Selector

Treeview continues to be one of the most common of the search keywords that bring folk to MyMSAccessBlog. I love developing with treeviews and if I can narrow down the specific questions folk are searching for answers to I'll post some detailed tips or solutions. For now, here's here's a zip file from Helen Feddema's Access Archon page with a working example:

The example uses a treeview to select books or authors to display information about.
Quote:
A TreeView control makes a better record selector than the standard combo box for situations where you are working with hierarchical data, and want to allow selection of an item from a branch of the data hierarchy.

For all my treeview posts click here.

Thursday, January 10, 2008

Getting Started with Treeviews: Posts from Microsoft

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 started with some Micsrosoft articles and found that was all I needed to build my first few treeviews. Here are the two I used plus one more I've found since that looks like it would have helped me a lot.

ACC97: Migrating from Data Outline Control to TreeView Control
How to fill a Treeview control recursively in Access 2000
How to use TreeView control Drag-and-Drop capabilities in Access 2000

As well as beginners' docs being a little scarce, the reference material can be hard to come by as well. Here's a link to the Treeview reference in the VB6 section of Microsoft's site.

See also: other treeview posts on my blog.

Tuesday, January 8, 2008

Working Treeview Example

Treeviews are one of my favourite user interface components to develop with. But judging by the questions on the discussion forums, a lot of folk have trouble getting started with them. Here's a simple working example from the code archive at www.UtterAccess.com.

See more treeview posts on my blog.