>>>>Hi evrybody,
>>>>
>>>>When the user enters data into the field, if the maximum length of the field is riched, the entering is continuing in the next field. How can I prevent it, e.g. when the maximum length is riched, the cursor stays in the field and no more keystrokes are accepted?
>>>>
>>>>Thanks in advance.
>>>
>>>
>>>SET CONFIRM ON
>>>
>>>
>>>HTH
>>
>>It doesn't fire Valid and LostFocus when the last symbol is typed, so I can not use it.
>
>So you need to fire one of this events and stay in the control?
>Then the suggestion with condition check on the interactivechage event is appropriate to your situation.
>
>Kind Regards
If doesn't seem to work. For instance, I have a textbox with controlsource BldMstr.Page (it's an integer field). I set MaxLength to 2 (for testing sake), but it still allows me to type 7 digits.
I tried the following code in textbox InteractiveChange:
if len(alltrim(this.text))>this.MaxLength
nodefault
endif
But it doesn't work either.
What else can I do? May be set confirm ON in interactive change? (Back to off in GotFocus)?
If it's not broken, fix it until it is.
My Blog