Instead of doing it in the data fields, do your validation when the
user clicks Save.
In your save routine, call a method to validate. This validation method
should return True/False, and the save method should decide to continue
saving based on that return value.
In the Validation routine, use this format:
LOCAL lRetVal, cMessage
lRetVal = .T.
cMessage = ""
WITH ThisForm
DO CASE
CASE EMPTY(.txtMyField1.Value)
cMessage = "The field 'MyField1' cannot be empty"
.txtMyField1.SetFocus()
CASE NOT BETWEEN(.txtMyField2.Value, nVal1, nVal1)
cMessage = "The field 'MyField2' is invalid"
.txtMyField2.SetFocus()
ENDCASE
IF NOT EMPTY(cMessage)
MESSAGBOX(cMessage, 48, "Some Caption")
lRetVal = .F.
ENDIF
ENDWITH
RETURN lRetVal
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people