Private Sub cmdValider_Click()
If Me.cboMois.ListIndex = -1 Then
MsgBox "Vous devez choisir un mois", vbInformation + vbOKOnly, "Choix d'un mois..."
Me.cboMois.SetFocus
Exit Sub
End If
If Me.cboCode.ListIndex = -1 Then
MsgBox "Vous devez choisir un code", vbInformation + vbOKOnly, "Choix d'un code..."
Me.cboCode.SetFocus
Exit Sub
End If
If Me.cboNom.ListIndex = -1 Then
MsgBox "Vous devez choisir un nom", vbInformation + vbOKOnly, "Choix d'un nom..."
Me.cboNom.SetFocus
Exit Sub
End If
MyDateDebut = DTPicker1.Value
MyDateFin = DTPicker2.Value
' Dans le cas où le choix est effectué sur le DTPicker1
If Me.cboMotif.ListIndex = -1 Then
Else
If MyDateFin <= MyDateDebut Then
MsgBox "La date de fin ne peut être inférieure à la date de début"
DTPicker1.SetFocus
Exit Sub
End If
End If ' Else
Sheets("Saisie").Activate
Range("A3:M3").Copy: Range("A3:M3").Insert Shift:=xlDown
Range("A3:M3").ClearContents
[A3] = Me.cboMois.List(Me.cboMois.ListIndex)
[B3] = Me.cboCode.List(Me.cboCode.ListIndex)
[C3] = Me.cboNom.List(Me.cboNom.ListIndex)
[D3] = Me.txtHS.Value '(Me.txtHS.Value)
[E3] = Me.txtGains.Value '(Me.txtGains.Text)
[F3] = Me.txtPrime.Value '(Me.txtPrime.Text)
[G3] = Me.txtAcpt.Value '(Me.txtAcpt.Text)
If Me.cboMotif.ListIndex = -1 Then
Else
[H3] = Me.cboMotif.List(Me.cboMotif.ListIndex)
[I3] = Format(MyDateDebut, "mm/dd/yyyy")
[J3] = Format(MyDateFin, "mm/dd/yyyy")
End If
[K3] = Me.txtCommentaire.Value
Unload Me
End Sub