码迷,mamicode.com
首页 > 数据库 > 详细

Access Treeview树节点代码二

时间:2018-05-01 13:55:12      阅读:215      评论:0      收藏:0      [点我收藏+]

标签:set   TreeView   dsc   integer   selected   next   CQ   dex   val   

Private Sub Form_Load()
‘引用C:\windows\system32\MSCOMCTL.OCX,否则提示出错。
Dim Rec As New ADODB.Recordset
Dim stRecQL As String
Dim Item As Integer
Dim i As Integer
Dim Node1 As Node
Rec.Open "GoodsCategoryQ", CurrentProject.Connection, adOpenKeyset, adLockOptimistic
For i = 0 To Rec.RecordCount - 1
If Rec!P_ID = "S0000" Then
Set Node1 = Me.TreeView0.Nodes.Add(, , "S" & Rec!C_ID, Rec!CategoryLabel)
Else
Set Node1 = TreeView0.Nodes.Add("S" & Rec!P_ID, tvwChild, "S" & Rec!C_ID, Rec!CategoryLabel)
‘Node1.Index = True
End If
Rec.MoveNext
Next
Rec.Close
End Sub


Private Sub Treeview0_NodeClick(ByVal Node As Object)
Me.L_Self.Caption = CStr(TreeView0.SelectedItem.index)
End Sub

Access Treeview树节点代码二

标签:set   TreeView   dsc   integer   selected   next   CQ   dex   val   

原文地址:https://www.cnblogs.com/ince/p/8975951.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!