Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
LostFocus and Valid
Message
From
22/05/2001 16:31:56
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00510008
Message ID:
00510071
Views:
16
>Hi All,
>
>I have a container that contains a mover control inside. The container has a custom valid method that is called in the LostFocus event. All works well unless the control is the last control on the form before the save button then is fails. While in the move control click on the SAVE button, the LostFocus fires, isValid returns .T., but the save is not executed.
>
>Is the work around for this problem?
>
>LOSTFOCUS
>
> IF This.IsValid
> DODEFAULT()
> ELSE
> NODEFAULT
> This.SetFocus()
> ENDIF

Assuming your save button is on a toolbar, the problem is that your control's validation is not firing when you click Save. Toolbars don't retake focus at all. The usual trick is to force a setfocus back to the control before saving, which will in turn fire validation and writing the value into the controlsource (because setting focus to one control forces the previous control to lose it first, never mind that it's the same one).

Just make sure that this.setfocus fires in the right moment, i.e. after you clicked save, but before any actual saving takes place.

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