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
|
'********************************************************************
'forcer le textbox a acepter que les chifre et met le tout au format date
'********************************************************************
' Modifier propriété MaxLength TextBox7 : 8
Private Sub TextBox7_Exit(ByVal Cancel As MSForms.ReturnBoolean)
TextBox7.Text = Format(TextBox7, "dddd dd/mmmm/yyyy")
End Sub
Private Sub TextBox7_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If InStr(entrees_entieres_permises, Chr(KeyAscii)) = 0 Then
KeyAscii = 0
MsgBox "ce caractere n'est pas permis"
End If
End Sub
Private Sub TextBox7_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If Len(TextBox7.Text) = 8 Then
madate = TextBox7
'ici on est obligé de rajouter les signes
madate = Mid(madate, 1, 2) & "/" & Mid(madate, 3, 2) & "/" & Mid(madate, 5, 4)
TextBox7 = Format(madate, "dddd dd/mmmm/yyyy")
End If
End Sub |