May 26, 200322 yr Hi All, I have a Global field which is validated by means of a button. The filed contains the day of the month ie; 1-31 Is there anyway in which I can script to accept ONLY numbers 1 thro 31 and NOT any alphas. I know I can do this if the field is not global, but that will defeat the purpose for which we are using it Many thanks, Benzie
May 26, 200322 yr Well, other than undocumented feature (set field as normal field, make your validation criteria and than reset it to global field) you could use: Set field(gField, Case(gField<=31 and gField>=1, gField,0) if(not gField) Show Message ("error") end if The first part will strip every alfa chars and return numeric value if data is in range otherwise it will return 0. Of course gField is global numeric field Dj
May 26, 200322 yr This is a bit of a weird workaround - but it works.. Define the field as a normal number field and set the validations to Numeric Only, in the range between 1 and 31. Set your invalid message to whatever you want and test it out to make sure that it works OK for you. Now, go back into Define Fields and change the field type from a Number to a Global field(Number). Ignore the warning you get about losing data. The validation will still work. Just a thought, but if you have selected the month/year in another field, you might want to use a validation by calculation to make sure you don't allow 30 for February etc.
May 26, 200322 yr Author Hi Djukic, Works like a charm! this has saved me heaps of time Many thanks - Paul
Create an account or sign in to comment