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
| ElseIf strStatut = "parent" Then 'Insertion d'une filiale qui reprend à son compte les filiales de sa société mère
MyErreur = "parent"
intNbreEnfants = tvClients.SelectedItem.Children
ReDim tbEnfantsOld((intNbreEnfants), 3)
intIndex = tvClients.SelectedItem.Index
Set ndNodexOld = tvClients.SelectedItem
Set ndNodex = tvClients.Nodes(intIndex).Child.LastSibling
strKeyLast = ndNodex.Key
Set ndNodex = tvClients.Nodes(intIndex).Child.FirstSibling
strKeyFirst = ndNodex.Key
For i = 0 To intNbreEnfants - 1
strKeyRemove = ndNodex.Key
tbEnfantsOld(i, 0) = ndNodex.Key
tbEnfantsOld(i, 1) = txtClient(1)
tbEnfantsOld(i, 2) = ndNodex.Text
If i < intNbreEnfants - 1 Then
Set ndNodex = ndNodex.Next
strKeyFirst = ndNodex.Key
End If
tvClients.Nodes.Remove strKeyRemove
Next i
Set ndNodex = tvClients.Nodes.Add(ndNodexOld, tvwChild, txtClient(0), txtClient(2), 1, 2)
strKeyFirst = ndNodex.Key 'Cette variable est libre, donc le l'utilise...
For i = 0 To intNbreEnfants - 1
Set ndNodex = tvClients.Nodes.Add(strKeyFirst, tvwChild, tbEnfantsOld(i, 0), tbEnfantsOld(i, 2), 1, 2)
Next i |
Partager