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
| Private Sub CommandButton2_Click()
Dim lig As Long
'ceci n'est valable que si le numero de contrat n'a pas changé
'sinon lors de la recherche precedente il faudra mettre en memoire
'quelque part le numero de contrat a rechercher et a modifier
If Trim(Me.TxtCtt.Value) = "" Then
Me.TxtCtt.SetFocus
Err = MsgBox("Entrer un numéro de contrat", vbOKOnly + vbQuestion, "Enregistrement refusé")
Exit Sub
End If
With TxtCtt
lig = CLng(.List(.ListIndex, (.ColumnCount - 1)))
End With
With Sheets(Etat)
.Cells(lig, 1).Value = Me.TxtDate.Value
.Cells(lig, 2).Value = Me.TxtHeure.Value
.Cells(lig, 3).Value = Me.TxtcPdt.Value
.Cells(lig, 4).Value = Me.TxtNom.Value
.Cells(lig, 5).Value = Me.TxtCiv.Value
.Cells(lig, 7).Value = Me.TxtPrn.Value
.Cells(lig, 8).Value = Me.TxtTel.Value
.Cells(lig, 9).Value = Me.TxtPrt.Value
.Cells(lig, 10).Value = Me.ComboClt.Value
.Cells(lig, 11).Value = Me.TxtPerio.Value
.Cells(lig, 12).Value = Me.TxtPdt.Value
.Cells(lig, 13).Value = Me.TxtCom.Value
.Cells(lig, 14).Value = Me.ComboPdt.Value
End With
End Sub |
Partager