Newbies TuffGuySF Posted June 27, 2005 Newbies Posted June 27, 2005 Hi, I am somewhat new at using FM6 but not a complete "newbie". I have a field that needs to be exactly 10 digits (no more or less) and the number can start with leading zeroes (ie - 0000123456). I cannot figure out how to set up a field like this. I've tried to do it using calculation but cannot seem to get it to work. My application has two fields in particular, one is 8 digits and one is 10 digits and my end users occasionally put the 8 digit code in the 10 digit space thus causing some reporting problems. Anyone done something like this before? Thanks in advance!
Slobey Posted June 27, 2005 Posted June 27, 2005 If you only have numbers and not spaces or dashes then validate by calculation: If(Length(number field) = 10,1,0) Make sure your number format is "Leave Data formatted as entered"
Newbies TuffGuySF Posted June 27, 2005 Author Newbies Posted June 27, 2005 OMG. Thanks so much. I have been banging my head on the desk over this one.
Vaughan Posted June 28, 2005 Posted June 28, 2005 No need for the IF because... Length(number field) = 10 ... will return 1 if true and 0 if false. In FMP 6 and earlier a number field will strip leading zeros, but a text field will not. I believe this has changed with FMP 7.
Recommended Posts
This topic is 7157 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