Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Limit String Input Length

Status
Not open for further replies.

IForgot

Programmer
Mar 20, 2002
122
0
0
US
I have a form with a number of Text Boxes in it.

The Text Boxes each have their own string Data Sources which have been initialized to a certain length such as:
m.cItemNo = SPACE(10)
m.cDesc1 = SPACE(4)

However when the user enters data into the form's text boxes they are allowed to enter more than the alloted number of characters.

One thing that I attempted was to modify the text box's Format property.
I tried putting:
!#### for Upper Case & only 4 char
but it did not limit user input.

How can I prevent this from happening?
How can I fix the number of characters to be entered?

Your advice will be greatly appreciated.

Thanks,
I_Forgot
 
Just put the "!" in the Format property and place the "####" in the InputMask property (it does not have any effect when placed in the Format property). Or should you rather use "XXXX" so it can accept alphabetic characters. "####" accepts only digits and blanks.

Medic
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top