Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Validation with DBC
Message
From
12/04/1998 13:38:23
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00090418
Message ID:
00091385
Views:
31
>>Is there any way or any command which can trigger the field validation in the lost focus event.
>>Puting the validation rule in lostfocus may not solve my problem if the user skip some fields(text boxes) by clicking on somewhere later part of the form while entering data and click on save thereafter.
>
>might be, but i haven't seen it. when we have your requirements, we added a property to each field on the form. if this property was true, the field was required. before saving, a method would be called to verify that all 'required' fields were entered. if not, they would be returned to the first required field that wasn't entered. they couldn't save the record until all were met.

I have a more general form of this problem, and I'm considering a solution along these lines. The general idea is somewhere about what you just said - I've added a LocalValid method to all of my control classes, and it gets called from wherever appropriate. That covers the Valid event (unless it shouldn't fire at all, like when clicking on any other nav button except Save, user pressed escape, or clicked the form's close box), though I plan to move it to LostFocus event; it also gets called from SaveRec method, for each bound control in a row, and as soon as one of them returns empty (this covers both returning .f. and 0), this control will regain focus.

I've found use of sys(1230) or whatever it was, object under mouse, to be a little pointless, because it fires even if mouse is accidentally left over a nav button. I'm trying to do something in commandgroup.gotfocus, to set a form's custom property to .f., so the general Valid routine could know if it should just return .t. or call the .localvalid method. Still working on it.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform