>We use Vfp3.0
>Since we don't want to write validation rules on the tables contained in the database.
>We prefer to validate the input on the valid method on the textbox.
>There is a 'Save' button on the form to update record. Can the Save button call all valid methods on the form?
I usually write separate methods for validation. And then a big method to call all them. The valid event of each field calls each one of the small ones.
It looks like this:
TxtName.Valid:
Return ThisForm.ValidTxtName()
Form.ValidateAll:
Local llRetVal
llRetVal = .T.
If llRetVal
llRetVal = This.ValidTxtName()
EndIf
If llRetVal
llRetVal = This.ValidAnyThing()
EndIf
Return llRetVal
* And so on
So in the save button I call:
If ThisForm.ValidateAll()
* Save the data
EndIf
Alexandre Nobre
Alpha Bytes Computer Corp.
Did you know that there are innocent people dying in East Timor?
It helps if you do...
I suppose you don't need glasses if you're able to read this line