Dim postLength As Integer
Private Sub Text1_Change()
Dim length As Integer
length = Len(Text1.Text)
If length = 3 And postLenght = 2 Then
Text1.Text = Text1.Text & " "
Text1.SelLength = 0
Text1.SelStart = 4
postLenght = 4
Else
postLenght = length
End If
Call DeltarAndra
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
Dim pointerPos As Integer, length As Integer
pointerPos = Text1.SelStart
length = Len(Text1.Text)
If (KeyAscii = vbKeyBack) And (pointerPos > 0) Then
Text1.Text = Left(Text1.Text, pointerPos) + Mid(Text1.Text, pointerPos + 1)
Text1.SelLength = 0
Text1.SelStart = pointerPos
ElseIf Not ((KeyAscii > vbKey0) And (KeyAscii < vbKey9)) Or (length >= 6 And Text1.SelLength < 1) Then
KeyAscii = 0
End If
If length = 3 And Not (KeyAscii = vbKeyBack) Then
Text1.Text = Text1.Text & " "
Text1.SelLength = 0
Text1.SelStart = 4
End If
End Sub