Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Validating a textbox field
Message
From
20/12/1997 17:02:29
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00067407
Message ID:
00067409
Views:
24
Allan,

The length of the field wires.CUTransit *IS* 8 characters,

You need to be testing the length of the Value.

Good luck,
Jim N

>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?
Previous
Reply
Map
View

Click here to load this message in the networking platform