skingjack2 Posted July 10, 2008 Posted July 10, 2008 Hello, This should be fairly easy but running into problems.. field remains blank. What I'm trying to is to confirm that the contents (a number) entered into a field is of certain length and if not return a text error message. Here is what I thought might work... If (Length(Field_name = 16); ""; "Please confirm the number") Is there something I may be overlooking and if so, can you point me in the right direction? TIA. Jack
Vaughan Posted July 10, 2008 Posted July 10, 2008 Where are you putting this calculation: in the field's validation options? Is the field of type text or number?
skingjack2 Posted July 10, 2008 Author Posted July 10, 2008 Vaughan, Using the calculation under the field validation options; the type of field is a number ( as in credit cards). HTH. Jack
Vaughan Posted July 10, 2008 Posted July 10, 2008 If it's a number then don't validate it as text, use a numerical range instead in the "within rage" option... 1000000000000000 to 9999999999999999 Note that this won't work if you expect the number to contain leading zeros; FMP will strip off the leading zeros in a number field (because numbers don't have leading zeros). In this case, DO use a text field to store the "number" (it's really a text string) and use the calculation Length( field ) = 16 You could get fancier and filter out all non-numeric characters in the validation calculation too. The validation message does not go into the validation calculation itself; it goes into the "display a message" panel at the bottom of the dialog. Lastly, note that validation occurs when the record is committed, not when the field is exited.
skingjack2 Posted July 10, 2008 Author Posted July 10, 2008 Hi Vaughan! Thanks for the update; I had just finished up tinkering with the field definition just prior to reading your response and they are equivalent. Everything works as planned =) Thanks for your assistance. Jack
Recommended Posts
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