Benzie Posted May 26, 2003 Posted May 26, 2003 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
djgogi Posted May 26, 2003 Posted May 26, 2003 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
RussBaker Posted May 26, 2003 Posted May 26, 2003 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.
Benzie Posted May 26, 2003 Author Posted May 26, 2003 Hi Djukic, Works like a charm! this has saved me heaps of time Many thanks - Paul
Recommended Posts
This topic is 7856 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