|
5#
楼主 |
发表于 2016-8-19 10:15:55
|
只看该作者
看了老师的回复,产生了一个疑问,按照这种思路,每一个树目录都会使用一个模块吗,能不能在模块中设置成动态的,需要使用的窗口都调用这个模块。
Public Function addTreeView(ObjTr As Object)
Dim ObjTree As Object
Dim objNode As Object
Dim rst As Object
Dim strParentID As String
Dim strSQL As String
Set ObjTree = ObjTr
ObjTree.Nodes.Clear
Set objNode = ObjTree.Nodes.Add(, , "K", "货品分类", 1, 2)
Set rst = CurrentDb.OpenRecordset("SELECT * FROM category_tabl ORDER BY categoryNumber", , dbReadOnly)
Do Until rst.EOF
Set objNode = ObjTree.Nodes.Add("K" & rst!categoryLevel, tvwChild, "K" & rst!categoryNumber, rst!CategoryName, 1, 2)
rst.MoveNext
Loop
ObjTree.Nodes(1).Expanded = True
rst.Close
Set rst = Nothing
Set ObjTree = Nothing
Set objNode = Nothing
End Function
这一段代码中的“货品名称”这该怎么修改成动态的啊,例如用窗体名称动态生成。 |
|