Lee J Posted May 1, 2001 Posted May 1, 2001 To all, I have a script that checks to make sure a 2 Letter abbreviation is entered into my Global field=Abbreviation. I can check to make sure the field isn't empty but Which function do I use to check it's not a number or the string contains a numerical value? i. A2, 34, B8B, ABC9 etc cheers in advance
BobWeaver Posted May 2, 2001 Posted May 2, 2001 Case(Position("0123456789",Left(Abbreviation,1),1,1),0, Position("0123456789",Middle(Abbreviation,2,1),1,1),0, Length(Abbreviation)>2,0, 1) This will return 0 (logical false) for invalid values, and 1 (logical true) for a good value.
Lee J Posted May 2, 2001 Author Posted May 2, 2001 Holy Cow!!, I wouldn't have thought of that, but it works a treat Thanks Bob really appreciate the help
Chuck Posted May 11, 2001 Posted May 11, 2001 BTW, a tip about validating global fields: you don't necessarily need to use a script to perform the validation. Try this: create a standard field of the type that the global field will eventually be (i.e., a number field if what you really want is a global number field). Set the validation for the field. Then change the field type from a normal field to a global field of the same type. The validation will stay with the field. Chuck
Chuck Posted May 11, 2001 Posted May 11, 2001 BTW, a tip about validating global fields: you don't necessarily need to use a script to perform the validation. Try this: create a standard field of the type that the global field will eventually be (i.e., a number field if what you really want is a global number field). Set the validation for the field. Then change the field type from a normal field to a global field of the same type. The validation will stay with the field. Chuck
Recommended Posts
This topic is 8655 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now