Private Sub TextBox23_AfterUpdate()
With TextBox23
If Len(.Value) < 10 And .Value <> "" Then MsgBox "date incomplete": .SetFocus: .SelStart = 0: .SelLength = 1
End With
End Sub
Private Sub TextBox23_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
With TextBox23
t = .Value
Select Case KeyCode
Case 96 To 105
t = t & Chr(KeyCode - 48)
If Len(t) = 2 Or Len(t) = 5 Then t = t & "/"
.Value = t
If Len(t) = 10 And Not IsDate(t) Then t = "": MsgBox "date invalide"
If Len(t) = 10 Then If CDate(t) < CDate(CbxBoursier) Then t = "": MsgBox "date inferieur"
KeyCode = 0
Case 8: t = Left(t, Len(t) - 1): KeyCode = 0
Case Else: KeyCode = 0
End Select
.Value = t
TextBox22 = Array("", "X")(Abs(t <> ""))
End With
End Sub