If not valid then don't return anything (but flag up a message box or something so they know they're being naughty)
IF This.Value $ "NY"
RETURN .T.
ELSE
Wait window "Who's been a naughty user then?" noclear
THIS.Value = ""
ENDIF
Incidentally, I always thought that valid had to return .T. or .F., or a number, but not either???
>Another problem I run into is on a textbox LostFocus I sometimes check to see if a value they entered exists in a table and I require them to put a value in that field. However, if they need to leave the form by pressing an exit button it still pops up the message. I would like it if they press the exit button that message won't come up. Can anyone help?
Couldn't this go in the textbox's valid as well, with the same criteria?
HTH
Terry
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.