March 21, 200223 yr I have a database which has a field with a pull-down menu with a very long list of schools that comes from a pre-defined value list. For reasons too long to go into in my short post, I cannot use field validations anywhere in my database so I have been forced to validate each field with a script. I have been using techniques such as "not IsBlank (myfield)" or "Length (myfield) = 12", etc. and it has worked without any problem. I need to know; however, if there is a way to check to make certain that the entry is from the list of schools provided using a script method because, again, I cannot use the standard field validation. I would consider hard-coding a list of schools in the script, but the list contains several hundred values which is likely to change from time to time so I would prefer having the program simply refer back to my pre-defined value list for validation. Does anyone have a good suggestion for doing this?
March 21, 200223 yr An imperfect-but-pretty-durn-good solution: In the file called "DB_Name": You have the TextField, which is the data entry field. You also have a Value List (here called "Text") Create a ValueList field, a calc field: ValueListItems("DB_Name", "Text") Create a Validation field, another calc field: If(PatternCount(ValueList, TextField) > 0, "", "NoGood") This will return nothing if the contents of the TextField are contained within the Value List, but if not, you'll see a "NoGood". HTH, Dan
Create an account or sign in to comment