On Error Resume Next
Dim dbs As Database
Dim rst As Recordset
Dim nodX As Node
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("accountsub", dbOpenDynaset)
Set nodX = TreeView0.Nodes.Add(, , "A", "دليل الحسابات")
With rst
Do While Not .EOF
Set nodX = TreeView0.Nodes.Add("A" & CStr(Nz(!no_account)), tvwChild, "A" & CStr(!no_subaccount), CStr(!no_subaccount) & ":" & !name_subaccount)
nodX.EnsureVisible
.MoveNext
Loop
End With
rst.Close
Set dbs = Nothing
For Each nodX In TreeView0.Nodes
nodX.Expanded = False
nodX.Sorted = True
Next