Sub TextField1_TextChanged (OldText As String, NewText As String)
CallSubDelayed(Me, "CutText")
End Sub
Sub CutText
If TextField1.Text.Length > 6 Then
TextField1.Text = TextField1.Text.SubString2(0, 6)
End If
End Sub
It works fine in debug mode but in release versions it does not. In debug it stops after 6 digits and it's not possible to enter another one.
In release you can enter 7 digits and they are shown in the text field. After entering another digit (now we have entered 8 digits) it cuts the digits in the textfield to six. But that is not the way I want it. I need the same behavoir like in debug mode.
Does anybody have a clue for me what I'm doing wrong?
Sub TextField1_TextChanged (OldText As String, NewText As String)
If NewText.Length > 6 Then
Sleep(20)
TextField1.Text = NewText.SubString2(0, 6)
End If
End Sub