|
5#
楼主 |
发表于 2010-3-24 12:54:15
|
只看该作者
这个搞定了,
我在“父”一级想把人员表中的姓名加进来,却又不行了,帮看看
'设置第二级"父"
'* ---------------------------
Rec.Open "地区表", CurrentProject.Connection, adOpenKeyset, adLockOptimistic, adCmdTableDirect
For i = 0 To Rec.RecordCount - 1
Set nodindex = TreeView.Nodes.Add("爷", tvwChild, "父" & Rec.Fields("地区编号"), Rec.Fields("省市名称"), "K1", "K2")
nodindex.Sorted = True
Rec.MoveNext
Next
Rec.Close
Rec.Open "人员名单", CurrentProject.Connection, adOpenKeyset, adLockOptimistic, adCmdTableDirect
For i = 0 To Rec.RecordCount - 1
Set nodindex = TreeView.Nodes.Add("爷1", tvwChild, "父1" & Rec.Fields("编号"), Rec.Fields("姓名"), "K1", "K2")
nodindex.Sorted = True
Rec.MoveNext
Next
Rec.Close |
|