>Hi Erik,
>Only Edit boxes have a maxlenght property. I am using a textbox which -at least in vfp3.0- does not have a maxlenght property. Any other ideas??
>Thanks Again Rick
Woops. I assumed that VFP 3 text boxes had the property too (they do in VFP 5 and later).
I don't have VFP 3, so I can't test, but you can try something like the following in the KeyPress event:
IF TYPE("THIS.Value") = "C"
IF LEN(THIS.Value) >= LEN(THIS.InputMask)
NODEFAULT
ENDIF
ELSE
IF LEN(ALLTRIM(STR(THIS.Value))) >= LEN(THIS.InputMask)
NODEFAULT
ENDIF
ENDIF
this will discard the keypress anytime the length of the value is already at the length of the input mask. I know, this should be automatic, but ....
Erik Moore
Clientelligence