General information
Category:
Forms & Form designer
>I am trying to close a form in the init of the form when a condition is true. The form closes fine but the _screen stays active.
>
>I am calling the form from a program.
>
>do form formname
>read events
>
>This is the code that I'm using in the init of the form
>
>if condition is .t.
> thisform.cmdexit.click
> return .f.
>endif
>
>
>thisform.cmdexit.click has the following code:
>
>local lnchoice
>if thisform.editmode=.t.
>lnchoice=messagebox("You have made changes to this record! Would you like to Save Changes?", 16+4, "Save Changes")
>if lnchoice=7
>thisform.editmode=.f.
>thisform.cmdcancel.click
>else
>thisform.cmdsave.click
>endif
>endif
>thisform.addlogrec(this.name, "")
>thisform.release
>Clear events
>
>
>I appreciate any suggestions that could point me in the right direction.
>
>TIA
I am not sure why you would want to click the exit button from the init. One record would have been changed? Why not just return .f.?
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only