MajP
You've got your good things, and you've got mine.
- Local time
- Today, 06:04
- Joined
- May 21, 2018
- Messages
- 9,493
Or something more advanced. All of this has to go at the beginning.
Constants, Enums, Class variables, Events
Constants, Enums, Class variables, Events
Code:
Option Compare Database
Option Explicit
'References: Microsoft Windows Common Controls
'If this in not in the list, browse for MSCOMCTL.OCX in the reference browser
'Normally located in C:\Windows\System32
'If you cannot find it download from microsoft
'MS scripting runtime if planning to save the sort order
'Microsoft Office 14 (or later) for command bars
Const ID_Field = "ID"
Const Parent_ID_Field = "ParentID"
Const Node_Text_Field = "NodeText"
Const Identifier_Field = "Identifier"
Const Image_Name_Field = "NodeImage"
Private WithEvents mTVW As TreeView
Private mQueryName As String
Private mRootParentID As String
Private mRecordSet As DAO.Recordset
Private mLoadType As lt_LoadType
Private mAllowDragDrop As Boolean
Private mTree As TreeView
Private mLoadImages As Boolean
'Consider if you want a PK and not the node
Public Event TreeviewNodeClick(SelectedNode As Node)
Public Event TreeviewNodeCheck(CheckedNode As Node, Checked As Boolean)
Public Event TreeviewNodeDragDrop(DragPK As Variant, DropPK As Variant, DragNode As Node, DropNode As Node)
Public Event TreeviewNodeDblClick(SelectedNode As Node)
Public Event RightClickOnNode(SelectedNode As Node)
Public Event RightClickOffNode()
Public Event NodeIterated(Node As Node)
Public Event ExpandedBranch(ExpandedNode As Node)
Public Enum lt_LoadType
lt_lightload = 1
lt_fullload = 2
End Enum