Hi,
is it possible to enforce a minimum amount of characters in a TextField?
I need my users to have to enter at least 2 numbers into a TextField. More digits are fine, but they must not only enter a single digit.
I have looked at the mask property and the language reference, but can’t seem to find what I need.
Thank you all in advance.
Tomas_J
(Tomas J)
June 10, 2013, 11:44am
2
simply add LostFocus Event to your Textfield, where you check the Text.Lenght Property.
Use the mask only if you need pre-formated text or digit formats.
Can’t seem to find a TextField.text.length property in the language reference??
.Text returns a String, which in turn has a .Len Property.
Sub LostFocus()
if me.Text.Len < 2 then
MsgBox "Please enter at least 2 characters"
me.SetFocus
end if
End Sub