1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
| Private Sub Form_Load()
Dim rstpersonnes As New ADODB.Recordset
Dim rstat As New ADODB.Recordset
rstpersonnes.ActiveConnection = CurrentProject.Connection
rstpersonnes.CursorType = adOpenKeyset
rstpersonnes.LockType = adLockReadOnly
rstat.ActiveConnection = CurrentProject.Connection
rstat.CursorType = adOpenKeyset
rstat.LockType = adLockReadOnly
Dim otree As TreeView
Dim NoRoot As Node
Dim NoCurrent As Node
Dim i As Integer
Dim j As Integer
rstpersonnes.Open "select*from personne"
If rstpersonnes.RecordCount > 0 Then
Set Me.TreeView0.ImageList = Me.imglst.Object
Set otree = Me.TreeView0.Object
otree.Nodes.Clear
i = 1
j = 1
K = 1
Set NoRoot = otree.Nodes.Add(, , "m" & i, "liste des personnes", "gland", "miam")
Do Until rstpersonnes.EOF
Set NoCurrent = otree.Nodes.Add(NoRoot, tvwChild, "e" & rstpersonnes!matricule, rstpersonnes!nom & " : " & rstpersonnes!prenom, "livrefermer", "livreouvert")
rstat.Open "select*from AT where matricule=" & "'" & rstpersonnes!matricule & "'"
Do Until rstat.EOF
Set NoCommandes = otree.Nodes.Add(NoCurrent, tvwChild, "f" & K, rstat!atdu & ":" & rstat!demandeati, "personne", "gland")
rstat.MoveNext
K = K + 1
Loop
Rstcommandes.Close
rstClients.MoveNext
'j = j + 1
Loop
rstpersonnes.Close
End If
End Sub |
Partager