首页 > 数据库技术 > 详细

access treeview读取数据表成树并与子窗体联动

时间:2018-05-04 00:27:58      阅读:556      评论:0      收藏:0      [点我收藏+]

Private Sub Form_Load()
Dim i As Integer
Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("SELECT * FROM menu;") ‘以要链接的表建立记录集
If rst.RecordCount = 0 Then MsgBox "表中无数据!程序终止。": Exit Sub ‘如果链接表无数据
i = 1
rst.MoveFirst ‘记录首
While Not rst.EOF ‘循环记录
With Me.TreeView0.Nodes ‘每循环1条记录添加一个分类
.Add , 4, "s" & i, "" & rst(1) & ""
End With
i = i + 1
rst.MoveNext ‘下一条记录
Wend
End Sub

Private Sub TreeView0_DblClick()
Me.win.SourceObject = "login"
End Sub

access treeview读取数据表成树并与子窗体联动

原文:https://www.cnblogs.com/ince/p/8988420.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!