I have a client who has used the & character in the customer No. field and need to prevent them doing so in future.
As they enter the No., I need to test the No. and if I find any reserved filter characters, issue a warning or ERROR(msg);
What is the best way to search for these characters (% + - | = .. ? @ <> *)?
TIA,
Colin
Experience is what you get when you hoped to get money
0
Comments
TempText := DELCHR(TempText,'=','-_+=\|[]}{".,#$@%^&*+!~`:;/?><');
or fill in the ValuesAllowed property of the field with only the characters you want 1,2,3,4,5,6,7,8,9,0,A,B,C,D....ETC. This will pop a message if a non listed character is entered.
Or use a similar code as above but opposite. DELCHR all the characters you want and if the result is not blank then ERROR.
http://www.BiloBeauty.com
http://www.autismspeaks.org
The Values Allowed does not work that way as far as I can tell, I have:
0;1;2;3;4;5;6;7;8;9;A;B;C;D;E;F;G;H;I;J;K;L;M;N;O;P;Q;R;S;T;U;V;W;X;Y;Z;1234
But trying to enter a No. of 1A gives an error saying that is not allowed. 1234 IS allowed.
Presumably you would have to have every possible combination set up?
Ideally, I would like to get any reserved characters and display them in the error message.
0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
That does it for me, the message is automatic if any other character is used.
I think the string needs to be:
(though the \ probably wont show in the message but you can play with that.)
The CharAllowed error message does show the \ so seems to be a good option but thanks David for you excellent response as always.
http://www.BiloBeauty.com
http://www.autismspeaks.org