Displaying Data in a Treeview Control

One of the powerful features of Access development is the ability to add an ActiveX control to any UI. Adding such controls, like the Calendar and Treeview controls, is a great way to add functionality and a pizzazz to any application, with minimal effort on your part.

The Treeview control is used to display any information that exists within a hierarchy of information. A hierarchy can involve any data contained within a one-to-one or one-to-many relationship. For example, Customers have Orders and Orders have line items that Northwind defines as Order Details. This section demonstrates how to add a Treeview control to a form and also how to populate and display the information based on user interaction with it.

To begin this example, start a new blank form. It does not need to be based on a recordsource, as the data population will occur only within the Treeview control. After the form is created, insert the

ActiveX control in the form by choosing Insert/ActiveX Control... from the main menu, as shown in Figure 10-8. The figure displays the ActiveX Control selection dialog box. For this example, the Treeview control is from Visual Basic 6, SP 6.

Insert ActiveX Control

Select an ActiveX Control:

Microsoft Tab5trip Control, version 5,0 (5P j Microsoft Terminal Services Control Microsoft Toolbar Control 6.0 (5P6) Microsoft Toolbar Control, version 5 0 (5P2

Microsoft TreeView Contro; 6.0 ÍSP6

Microsoft TreeView Control, version 5,0 (5Í Microsoft UpDown Controi 6.0 (5P4) Microsoft UpDown Control, version 5.0 (5P Microsoft Web Browser Microsoft Windows Report Control Microsoft WinSock Control, version 6,0

Cancel

Result

Inserts a new Microsoft TreeView Control 6,0 (5P6) into your document.

0 0

Post a comment