One way I found would be to:
- Unbound the textbox from the date field
- Format = "R"
- InputMask = "9999/99/99"
- Valid():
IF NOT Empty(THIS.Value) AND;
Empty(CToD(Left(THIS.Value, 4) + "/" + SubStr(THIS.Value, 5, 2) + "/" + Right(THIS.Value, 2)))
WAIT WINDOW "The date is invalid"
RETURN .F.
ELSE
REPLACE MyDateField WITH THIS.Value
ENDIF
There still room for improvements, because of the hard coded date format, but it's a start.
>If you drop a textbox on a for with the value property set to =date() you have a txtbox field that will check for a valid date. If you input a invalid date VFP will display a wait window with "Invalid Date".
>
>How can I change the messages displayed for a different Messages?