Private Sub TextBox2_Change() If Len(TextBox2.Text) = 2 Then If Val(TextBox2.Text) > 31 Or Val(TextBox2.Text) < 1 Or IsNumeric(TextBox2.Text) = False Then TextBox2.Text = "" Else TextBox2.Text = TextBox2.Text & "/" End If End If If Len(TextBox2.Text) = 5 Then If Val(Right(TextBox2.Text, 2)) > 31 Or Val(Right(TextBox2.Text, 2)) < 1 Or IsNumeric(Right(TextBox2.Text, 2)) = False Then TextBox2.Text = "" Else TextBox2.Text = TextBox2.Text & "/" End If End If End Sub
Private Sub TextBox2_Change() If Len(TextBox2.Text) = 2 Then If Val(TextBox2.Text) > 31 Or Val(TextBox2.Text) < 1 Or IsNumeric(TextBox2.Text) = False Then TextBox2.Text = "" Else TextBox2.Text = TextBox2.Text & "/" End If End If If Len(TextBox2.Text) = 5 Then If Val(Right(TextBox2.Text, 2)) > 31 Or Val(Right(TextBox2.Text, 2)) < 1 Or IsNumeric(Right(TextBox2.Text, 2)) = False Then TextBox2.Text = Left(TextBox2.Text, 3) Else TextBox2.Text = TextBox2.Text & "/" End If End If End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question