procedure thisform.cmdbutton1.click thisform.logicalvalue=!thisform.logicalvalue if thisform.logicalvalue=.t. do xxxxxx else do xxxxx endif endproc