LonnieJohnson
Programmer
I want to add a character to a string while a user is typing. I want to add slashes (/) to a field sort of like a date mask.
This is what I have so far in the key press event...
If Len(TextBox1.Text) = 2 Or Len(TextBox1.Text) = 5 Then
e.Handled = True
TextBox1.Text &= "/"
TextBox1.Select(TextBox1.Text.Length, 0)
End If
Two problems
1. If I type 102504 (Today's date) It will not type the third char.
2. If I back space it will not go all the way back.
I snipped this code from somewhere else. Thanks.
ProDev, MS Access Applications
Visit me at ==>
May God bless you beyond your imagination!!!
This is what I have so far in the key press event...
If Len(TextBox1.Text) = 2 Or Len(TextBox1.Text) = 5 Then
e.Handled = True
TextBox1.Text &= "/"
TextBox1.Select(TextBox1.Text.Length, 0)
End If
Two problems
1. If I type 102504 (Today's date) It will not type the third char.
2. If I back space it will not go all the way back.
I snipped this code from somewhere else. Thanks.
ProDev, MS Access Applications
Visit me at ==>
May God bless you beyond your imagination!!!