Information générale
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Using return in the valid process
Versions des environnements
I have a few different forms that have one character fields and I want the user to only have a few choices of forms to choose from. For example a Yes and No I put the following code in the Valid
IF This.Value $ "NY"
RETURN .T.
ELSE
THIS.Value = ""
RETURN 0
ENDIF
This just says if they don't enter a Y or N don't let them leave until they do. This works fine most of the time but sometimes the user just wants to exit the form all together and it won't let them do that until they enter a valid value in . Is there a way I can tell when they are trying to press the close button and to let them without having them enter a valid value into that textbox first?
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?
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement