Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: SQL
Expertise: Beginner
Mar 24, 1997



Building the Right Environment to Support AI, Machine Learning and Deep Learning

User changes

I want to be able to take an action when a user changes the value of a data field, but not when the value of the field is changed by code. How can I do this?

The PostChange() method for a data field is called whenever the value of the field is changed by code or user interaction. The Validate() method is only called when a value is changed by a user.

When the Validate() method is called, the Value of the data field is the original value of the field. The new value for the field is in a variable called newval. You can compare the new value and the old value and in the Validate() method.

If you return TRUE from the Validate() method, normal processing continues. If you return FALSE from the method, the focus is left in the data field and subsequent actions are cancelled. You have to remember to explicitly return TRUE from the Validate() method; the default return is FALSE, which can cause unintended results.

DevX Pro
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date