1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| Private Sub numaff_Change()
If comcreation.numaff.Value <> "" Then
comcreation.Numclient.Caption = numerosaff.Cells(comcreation.numaff.ListIndex + 6, 5)
End If
'si c'est la première commande sur ce numero d'affaire
Dim temp1 As Range
Dim temp As Long
Set temp1 = commandes.Range("I:I").Find(comcreation.numaff.Value, commandes.Cells(6, 9), xlValues, xlWhole, xlByRows, xlNext)
If temp1 Is Nothing Then
comcreation.devis.Enabled = True
Else
temp = temp1.Row
comcreation.devis.Enabled = False
comcreation.montantdevis.Value = commandes.Cells(temp, 27)
End If
End Sub |