标题: TreeSelect????????? [打印本页] 作者: zyz218 时间: 2005-12-16 22:37 标题: TreeSelect????????? Private Sub 添加物料菜单()
TreeSelect.Nodes.Clear
Dim WL As DAO.Recordset
Set WL = CurrentDb.OpenRecordset("部品")
WL.MoveFirst
For i = 1 To WL.RecordCount
WL.edit
Select Case Len(WL("系统编码"))
Case 3
TreeSelect.Nodes.Add , , "A" & WL("系统编码"), WL("系统编码") & " " & WL("名称")
Case 6
Father系统编码 = Left(WL("系统编码"), 3)
TreeSelect.Nodes.Add "A" & Father系统编码, tvwChild, "A" & WL("系统编码"), WL("系统编码") & " " & WL("名称")
Case 9
Father系统编码 = Left(WL("系统编码"), 6)
TreeSelect.Nodes.Add "A" & Father系统编码, tvwChild, "A" & WL("系统编码"), WL("系统编码") & " " & WL("名称")
Case 12
Father系统编码 = Left(WL("系统编码"), 9)
TreeSelect.Nodes.Add "A" & Father系统编码, tvwChild, "A" & WL("系统编码"), WL("系统编码") & " " & WL("名称")
Private Sub 添加物料菜单()
TreeSelect.Nodes.Clear
Dim WL As DAO.Recordset
Set WL = CurrentDb.OpenRecordset("部品")
WL.MoveFirst
Do Until WL.EOF
WL.edit
Select Case Len(WL("系统编码"))
Case 3
TreeSelect.Nodes.Add , , "A" & WL("系统编码"), WL("系统编码") & " " & WL("名称")
Case 6
Father系统编码 = Left(WL("系统编码"), 3)
TreeSelect.Nodes.Add "A" & Father系统编码, tvwChild, "A" & WL("系统编码"), WL("系统编码") & " " & WL("名称")
Case 9
Father系统编码 = Left(WL("系统编码"), 6)
TreeSelect.Nodes.Add "A" & Father系统编码, tvwChild, "A" & WL("系统编码"), WL("系统编码") & " " & WL("名称")
Case 12
Father系统编码 = Left(WL("系统编码"), 9)
TreeSelect.Nodes.Add "A" & Father系统编码, tvwChild, "A" & WL("系统编码"), WL("系统编码") & " " & WL("名称")