>Is there a property to set which will allow the triggering of the Valid() event if and only if the value of cell of a text or combo box has changed?
>
>For example the user tabs into the cell and then tabs out I would only wish that the valid() event be performed if the user changed the value while in the cell. If the user made absolutely no change I wish the valid not be performed.
>
>Is there a simple solution for this?
>
>Thanks in advance!
If you controls are class based, you can add the following modifications to these classes:
Add 2 new properties to every class:
PreviousValue
ValidateAlways (this would be a property to validate even if no changes were made at all).
In GotFocus event of your controls add:
this.PreviousValue = this.value
in Valid add
if this.ValidateAlways or this.value<>this.PreviousValue
execute your validation code
endif
If it's not broken, fix it until it is.
My Blog