|
Private Sub Form_Load()
Dim Rec As New ADODB.Recordset
Dim stRecQL As String
Dim Item As Integer
Dim i As Integer
Dim nodIndex As Node
Me.xxzct.Form.AllowAdditions = True
Me.xxzct.Form.AllowDeletions = True
Me.xxzct.Form.AllowEdits = True
Me.xxzct.Locked = False
Rec.Open "usysuser", CurrentProject.Connection, adOpenKeyset, adLockOptimistic, adCmdTableDirect
For i = 0 To Rec.RecordCount - 1
Set nodIndex = TreeView.Nodes.Add(, , "父" & Rec.Fields("userID"), Rec.Fields("username"), "K1", "K2")
nodIndex.Tag = Rec.Fields("userID")
nodIndex.Sorted = True
Rec.MoveNext
Next
Rec.Close
End Sub
Private Sub Treeview_NodeClick(ByVal Node As Object)
Dim strFilter As String
If Node.Text = "用户权限" Then
strFilter = ""
Else
strFilter = "[用户名]=" & Node.Tag
End If
'对子窗体进行筛选
Me.xxzct.Form.Filter = strFilter
Me.xxzct.Form.FilterOn = True
Me.xxzct.Form.AllowAdditions = True
Me.xxzct.Form.AllowDeletions = True
Me.xxzct.Form.AllowEdits = True
End Sub |
|