Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Do all Valid
Message
From
07/03/1997 06:45:33
 
 
To
07/03/1997 05:35:17
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00023276
Message ID:
00023278
Views:
30
>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

Previous
Reply
Map
View

Click here to load this message in the networking platform