Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Validating a textbox field
Message
From
24/12/1997 01:26:56
Bill Benton
North Florida Software Services
Middleburg, Florida, United States
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00067407
Message ID:
00067799
Views:
28
Why don't you try:

IF LEN(ALLTRIM(this.value))<>8

Bill Benton

>I have a form in which I test for two items in a certain field:
>
>1. That the user has keyed in 8 characters
>
>2. That the last four characters are "7879"
>
>This is the code in the valid method of the textbox:
>
>** start - Valid method of textbox **
>
>al = len(wires.CUtransit) && create memory variable to
>save to zzz all like al && see what VFP says is the length of expression
>
>
>IF len(this.value)<>8
>=messagebox("Transit Number must be 8 characters [ie. 12347879] !",16,oCUWS.appname)
>else
> if right(this.value,4)<>"7879" and len(this.value) = 8
> =messagebox("Transit Number must end with '7879' !",16,oCUWS.appname)
> endif
>endif
>
>*** end ***
>
>When I enter two characters, the memory variable 'al' returns 8 as the length of the expression. I can't seem tp trap for the user entering less than 8 characters.
>
>Any ideas in what I am doing wrong here?
Bill Benton
Senior Systems Analyst
Nuvell Financial Services
Previous
Reply
Map
View

Click here to load this message in the networking platform