Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid valid does not fire
Message
From
07/05/2009 21:52:54
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01396480
Message ID:
01398497
Views:
69
>I believe it "finally" dawned on me that there was an issue with that code. if the mouse pointer is left on the add or edit button after either are clicked, the Valid or LostFocus code does not run, "by design"...crap! I have had issues like this (valid code not running), intermittently for a while. Who knows why the light-bulb just turned on! It helps to have the coverage profiler turned on.
>
>When I removed the above reference to "cmdedit, cmdadd" the code works.
>
>Is there a better way to keep the valid from running when closing the form or canceling a process?

I once solved that by moving code from cmdbutton.click() to cmdbutton.when() - and returning .f., so the button never gets the focus. In case of OK button, I'd just thisform.activecontrol.setfocus(), which would force it to regain focus, and to do that it has to lose it first, so the validation fires.

Not sure this is the cleanest way, but at least I didn't have any concerns in the validation about whether it's been fired by a button or by user's simply leaving one control to get to the next.

back to same old

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

Click here to load this message in the networking platform