>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.