IF NOT EMPTY(This.Value)
micode = This.Value
valmicode = IsBlack(micode)
IF ! valmicode
SELECT products
SET ORDER TO icode
SEEK micode
IF FOUND()
.... displays values
ELSE
scat memv blank
ENDIF
ELSE
nanswer= messagebox("Do you wish to exit ?",4+32+256, "Your Selection",0)
DO CASE
CASE nanswer = 6
ThisForm.Release
OTHERWISE
This.SetFocus
Nodefault
ENDCASE
ENDIF
ENDIF
You may need to do some extra validation when you close the screen or save the record based on having an empty value in this field.
>Hi All
>
>I created a product entry form on which I have one text box (micode). In lost focus event of the said box I type the following codes:
>
>micode = This.Value
>valmicode = IsBlack(micode)
>if ! valmicode
>select products
>set orde to icode
>seek micode
>if foun()
>.... displays values
>else
>scat memv blank
>endif
>else
>nanswer= messagebox("Do you wish to exit ?",4+32+256, "Your ;
>Selection",0)
>do case
>case nanswer = 6
>ThisForm.Release
>other
>This.SetFocus
>Nodefault
>endcase
>endif
>
>Now, the question is, if I click on find button (if I want to find a specific record relating to this ) in commandgroup button (cmdFind) it checks the routine in lostFocus of the text box which is ofcourse blank and therefore it displays the message "Do you wish to exit ?". It really irritating, how can I overcome this ? Is there any idea for the better solution.
>
>Please help !
>
>Saify