July 10, 200817 yr 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
July 10, 200817 yr Where are you putting this calculation: in the field's validation options? Is the field of type text or number?
July 10, 200817 yr Author Vaughan, Using the calculation under the field validation options; the type of field is a number ( as in credit cards). HTH. Jack
July 10, 200817 yr 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.
July 10, 200817 yr Author 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
Create an account or sign in to comment