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添加引用就可以了