General information
Category:
Coding, syntax & commands
Title:
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
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only