I'm not sure that I understand your examples.
Reducing opportunities for data entry errors usually requires careful thought and a layout design that prevents as many errors as possible, then checks for errors that can't be prevented after data entry is complete. Thus many of the following options are used in combination:
If you want to make sure that a field always has the value Cat or Dog in the field, you can define a validation calculation such as:
self = "dog" or self ="cat"
IF the field can also be empty:
IsEmpty (self) or self = "dog" or self ="cat"
But this traps for an error after the user has made an error. You can also define a field format with a value list such that "cat" and "dog" are the only options permitted for entering data into that field. If the field cannot be left empty, there's a specific validation option that will show an error if the field is left empty.
If you want to use an auto-complete enabled drop down list, but limit input to only values from the list, there's a validation option that will limit data in the field to only data that is a member of the value list.
Sometimes an auto-enter calculation such as:
TextFormatRemove(Self) //removes pasted or user selected text formats
GetValue ( self ; 1 ) // keeps user from selecting more than one radio button by holding down the shift key while clicking
will be used to prevent data entry errors.
And for maximum flexibility and user friendliness when trapping and possibly correcting data entry errors, the OnObjectValidate trigger can be used to check for and even correct user errors before any built in error checking can kick in.
I want the field to never be empty, could that also be:
self = "dog" or self ="cat" or self=1
IF the only permitted values are dog, cat or 1. That doesn't seem likely for most actual situations.
For the purpose doing doing other things like with relationships like filtering and using ExecuteSQL I have ran in to trouble when a field is Empty, "", or False
yes, but using self = 1 does not guarantee that the field is not empty. It requires that the value in the field be 1.
There's a validation option where you can just click a check box to specify that the field may not be left empty.
So once checked and a Validated by calculation should do it?
Yes, but as I stated in my first post,
self = "dog" or self = "cat"
will also trap for empty values--you don't need any other setting as an empty value will not evaluate as true with that expression.
And I still don't see why you are also using: or self = 1 unless you want to permit only values of dog, cat or 1 as valid data for the field.
I totally understand. The concept you give helps, however in this case I do very much need the 1. I have always wondered what my C++ instructor meant by trapped. You have really made me understand here. Great!