|
下列代码一旦加上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 |
|