Office中国论坛/Access中国论坛

标题: 请教treeview的nodeclick事件如何使用? [打印本页]

作者: lexy2k    时间: 2006-9-30 00:07
标题: 请教treeview的nodeclick事件如何使用?
下列代码一旦加上nodeclick事件处理模块就出错,为什么?帮帮吧。

Private WithEvents Treevw As TreeView
Private Sub Form_Load()
    treeLoad
    Set Treevw = Me.TreeView0.Object
End Sub

Private Sub treeLoad()
'* -----------------------------------------------------------------
    Dim Rec As New ADODB.Recordset
    Dim stRecQL As String
    Dim Item As Integer
    Dim i As Integer
    Dim nodindex As Node
'* -----------------------------------------------------------------
    '设置最顶级"
    Set nodindex = TreeView0.Nodes.add(, , "f0", "方案", "K1", "K2")
    nodindex.Sorted = True
'* -----------------------------------------------------------------
    '设置第二级
    Rec.Open "期间", CurrentProject.Connection, adOpenKeyset, adLockOptimistic, adCmdTableDirect
    For i = 0 To Rec.RecordCount - 1
        Set nodindex = TreeView0.Nodes.add("f0", tvwChild, "qj" & Rec.Fields("期间_ID"), Rec.Fields("期间_NO"), "K1", "K2")
        nodindex.Sorted = True
        Rec.MoveNext
    Next
    Rec.Close
End Sub


Private Sub Treevw_NodeClick(ByRef Node As Object)
End Sub
作者: 白河寒秋    时间: 2007-7-11 17:58
天涯同病鸟,我也遇到了这个问题,在mdb中运行正常的viewtree移到ADP中就不可以用了
作者: dreamsding    时间: 2007-7-12 01:20
请教高手
作者: LeeTia    时间: 2008-9-26 16:52
标题: 应该是没有引用ADO
在非调试状态进入VBA添加引用就可以了




欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) Powered by Discuz! X3.3