Newbies eeau1973 Posted May 17, 2008 Newbies Posted May 17, 2008 Hi everybody, i´m new usingfile maker and I don´t know how to validate that the user must just input 12 chars into a field ... Actually if the user input more that 12 chars into a field i get the message, "sorry, you must enter 12 chars... (I write this messahe into the Display custom message if validation fails option), and this happens (i think) because i´m reading data from a mysql database (using ODBC connector and that field is defined as a varchar type and size 12 ). I also try to use the Length(field) funtion but is not working ... Would somebody please help me with this issue ? Thanks in advance ....
Matthew F Posted May 18, 2008 Posted May 18, 2008 Checking 'Validate by calculation' and specifying the following calculation should work: length(field) = 12
Lee Smith Posted May 18, 2008 Posted May 18, 2008 I also try to use the Length(field) funtion but is not working ... I was going to recommend the Length Function earlier, but didn't because of what you wrote. I wasn't at my desk at the time, so I left it until now. Please explain why it didn't work. Lee
Newbies eeau1973 Posted May 19, 2008 Author Newbies Posted May 19, 2008 The length function is not working because it takes 12 as a value, so if I don´t input 12 in the field that i´m validating there is always the custom message warning .... thanks any way!
LaRetta Posted May 19, 2008 Posted May 19, 2008 (edited) I believe you are misinterpreting Length() and validation in general. A validation calculation only produces 1 or 0, true or false. The validation must produce true. If it produces false, the validation message will fire. So a validation by calculation of: Length ( thatField ) = 12 ... means the field must contain exactly 12 characters or it will fail validation. If you can tell us EXACTLY what you are doing, we can find out why it breaks. :wink2: Edited May 19, 2008 by Guest
LaRetta Posted May 19, 2008 Posted May 19, 2008 To explain just a bit more ... The length function is not working because it takes 12 as a value, No. Length() counts how many characters are in a field. So in your situation, you are asking a question: Does the length of that field equal 12? It has nothing to do with the data itself; it only counts the number of characters. But I wonder ... are you editing SQL fields directly? If you are, it may not be validation which is failing but rather your privileges to modify a SQL field. Just another consideration ... Anyway, the calc Matthew gave indeed works and as Lee asked, please provide details of what you have, what you are doing and what the error message specifically says.
Recommended Posts
This topic is 6092 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