Naomi,
Valid is a method that handles the Valid event. Calling the event handler does not raise the event. You have a couple options: raise the event yourself or have VFP raise the event for you. To raise the event yourself, try replacing the "thisform.activecontrol.valid()" with this:
RAISEEVENT(thisform.ActiveControl, 'Valid')
Or, to have VFP raise the event for you, replace that line with this:
thisform.ActiveControl.SetFocus()
That will cause a loss of focus and the control to receive focus again forcing the valid to fire.
HTH,
Chad
>Hi everybody,
>
>I have several controls on my form including edtNotes. All controls are unbound. In QueryUnload method I have:
>
>
>LOCAL llReturn
>thisform.lIsClosing = .t.
>
>if type('THISFORM.ActiveControl') = 'O' and not ;
> isnull(thisform.activecontrol) and PEMSTATUS(thisform.activecontrol,'valid',5) ;
> and inlist(lower(thisform.activecontrol.baseclass),'textbox','editbox')
> thisform.activecontrol.valid()
>endif
>
>llReturn = dodefault()
>
>thisform.lIsClosing = .f.
>
>RETURN m.llReturn
>
>Yet when I type in edtNotes and then click on close button in the upper right corner of the form, the value just goes away. What can I do to prevent this behavior?
>
>Thanks in advance.
_________________________________
There are 2 types of people in the world: