Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
Field-level rules vs. code in the Valid event
I'm still learning the ins and outs of VFP (having recently made the switch from Clipper).
I was just playing around with a textbox control that is bound to a field in a table. I put a field-level rule expression (a UDF actually) in the DBC and noticed that when it fails I get an ugly "stock" VFP error message. So I added my own text in the message box in the DBC. This is better but still not perfect. Then I pondered the possibilty that my validation UDF may actually require different error messages based on the data entered. I took the message out of the DBC and put it in my UDF. Now I'm getting my error and the ugly VFP one. So then I shifted to the Valid event hoping that I could validate using DBGETPROP and retrieving the field-level rule expression. The problem is that it appears the field-level rule is triggered before the textbox's valid.
What should my approach be to this sort of situation?
TIA
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