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!

Hi everry body. some helpme with the letter please

Status
Not open for further replies.

bigdad

Programmer
Jul 17, 2001
34
0
0
VE
Hi to every body, my problem is: I have a textbox and I need limit the input to only five letters. In other words, its value just is limited to any five specific letters. and I don´t know how I can do it. I thought it might involve its ASCII value and work with the CASE/ENDCASE but I didn´t find its value.

If somebody knows how do this, please let me know.


Really I hope somebody can help me

Bigdad
 
Use the picture clause, any char put in XXXXX, only numbers put in 9999, only upper case alpha put in !!!!!. Put the number of these for the max cahr's to enter
 
You can also set the Textbox property MaxLength to 5, if you don't want to use an InputMask.

Rick
 
Do you mean only allowing a total length of five characters, or limiting to a length of five containing specific characters, or length of 1 which can only be one of five characters?

Since one of the scenarios has already been answered, I'll put in my answer for another. If you have a textbox one character in length, and only want one of five characters in it, you can put something like this in the VALID event:

IF This.Value $ 'AEIOU'
RETURN .T.
ELSE
RETURN .F.
ENDIF

Make sure you set the Input Mask property to '!' also so it will force input to one character.

Dave S.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top