|
8#
楼主 |
发表于 2009-2-8 14:52:29
|
只看该作者
1博士---2科研课题表
----3中医科研表
---4中医内科科研表
--4中医外科科研表
----3西医科研表
---2临床课题表
1硕士---2科研课题表
---2临床课题表
建立这样的树形结构,当我单击“5中医内科(脾胃)科研表”时,就能进入“5中医内科(脾胃)科研表”这个窗体。请问你有什么办法么???
请赐教!!!!!!!!!
同时我想在每个节点前加入图标应该怎样操作?????
我在论坛上看到了一些代码是这样的:
Option Compare Database
Private Sub Form_Load()
treeview1.LineStyle = tvwRootLines
treeview1.Nodes.Add , , "boshi", "博士"
treeview1.Nodes.Add "boshi", tvwChild, "keyan1", "科研课题表"
treeview1.Nodes.Add "keyan1", tvwChild, "zhongyikeyanbiao", "中医科研表"
treeview1.Nodes.Add "zhongyikeyanbiao", tvwChild, "zhongyineikekeyanbiao", "中医内科科研表"
treeview1.Nodes.Add "zhongyikeyanbiao", tvwChild, "zhongyiwaikekeyanbiao", "中医内科科研表"
treeview1.Nodes.Add "keyan1", tvwChild, "xiyikeyanbiao", "西医科研表"
treeview1.Nodes.Add "boshi", tvwChild, "linchuang1", "临床课题表"
treeview1.Nodes.Add , , "shuoshi", "硕士"
treeview1.Nodes.Add "shuoshi", tvwChild, "keyan2", "科研课题表"
treeview1.Nodes.Add "shuoshi", tvwChild, "linchuang2", "临床课题表"
treeview1.Nodes.Add , , "benke", "本科"
treeview1.Nodes.Add "benke", tvwChild, "keyan3", "科研课题表"
treeview1.Nodes.Add "benke", tvwChild, "linchuang3", "临床课题表"
End Sub
********下面的编程我就不会了********************
*******请高手指点迷津,万分感激******************
Private Sub treeview1_nodeclick(ByVal Node As Object)
On Error Resume Next
If Node.Children = 0 Then
DoCmd.OpenForm treeview1.SelectedItem.Parent.Text & treeview1.SelectedItem.Text
End If
End Sub
********************************************************************** |
|