|
本帖最后由 laiguiyou 于 2010-4-20 15:42 编辑
在树里,为什么月份下面无法显示订单号。
'设置最顶级的"爷"
'* ---------------------------
Set nodindex = TreeView.Nodes.Add(, , "爷", " 订单查询", "k1", "k2")
nodindex.Sorted = True
nodindex.Expanded = True '展开树
'* -----------------------------------------------------------------
'* -----------------------------------------------------------------
'设置第二级"父"
'* ---------------------------
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("父" & Rec.Fields("年度"), tvwChild, "子" & Rec.Fields("月份"), Rec.Fields("月份"), "k1", "k2")
nodindex.Sorted = True
Rec.MoveNext
Next
Rec.Close
Set Rec = Nothing
'
'设置第四级"孙"
'* ---------------------------
Rec.Open "生产单号", CurrentProject.Connection, adOpenKeyset, adLockOptimistic, adCmdTableDirect
For i = 0 To Rec.recordcount - 1
Set nodindex = TreeView.Nodes.Add("子" & Rec.Fields("月份"), tvwChild, "孙" & Rec.Fields("生产单号"), Rec.Fields("生产单号"), "K1", "K2")
nodindex.Sorted = True
Rec.MoveNext
Next
Rec.Close
这句红色的代码错在哪里
。
是用查询做的 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|