i have an exit button that works with this condition: parentform.mode_get() = "Change"
my problem is that when i pushed the buttons the form doesn't close..
i also have a save button on the form i would like if i push the save button then the exit button should just close the form..
i know that my code may be weird but i'm in the programming world for only a few months..
thanks in advanced
costantina
my problem is that when i pushed the buttons the form doesn't close..
i also have a save button on the form i would like if i push the save button then the exit button should just close the form..
i know that my code may be weird but i'm in the programming world for only a few months..
thanks in advanced
costantina
Code:
ui_dlg_box("VICTORY EXPLORER",<<%dlg% {wrap=40} {lf}; {image=$sys_question} Do you want to save the record?; {lf}; <&Save> <&Don't Save> <&Cancel> %dlg%,<<%code% if a_dlg_button = "&Save" then DIM mode as c 'Save record in current form. topparent.commit() 'Set 'Value' property of 'Last_updated DIM form_name as c if is_object(topparent.this) then form_name = topparent.name()+".this" else form_name = "" end if DELETE expression_result expression_result = eval("date()",form_name) parentform:Last_updated.value = expression_result 'Close current form or browse window. DIM mode as c mode = parentform.mode_get() 'If the form is in Change mode, first save the changes before closing the form if mode = "ENTER" .or. mode = "CHANGE" then parentform.commit() 'Check to see if the record was successfully saved if parentform.mode_get()<>"VIEW" then ui_msg_box("Unable to save your changes","Please correct and save, or discard your changes", UI_STOP_SYMBOL) end end if end if 'Close the form if a_dlg_button = "&Don't Save" then parentform.close(.f.) end if end if if a_dlg_button = "&Cancel" then cancel() end end if %code%)
Comment