Normal Topic FormExit() (Read 1129 times)
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
FormExit()
Jul 10th, 2007 at 3:17pm
Print Post Print Post  
Hi-
I want to use Formexit() to close the form and go back to the Main Menu. 

I use this on a command button.  Clicking the button is nothing happen :

FormExit("Client")

Client is the Form Name

What am I doing wrong?


Thanks.

  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: FormExit()
Reply #1 - Jul 10th, 2007 at 3:39pm
Print Post Print Post  
Quote:
Hi-
I want to use Formexit() to close the form and go back to the Main Menu. 

I use this on a command button.  Clicking the button is nothing happen :

FormExit("Client")

Client is the Form Name

What am I doing wrong?


FormExit cannot close the current form.

From the docs:
Code
Select All
This command cannot close the current form or any form which is open as a subform of another form.  

  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: FormExit()
Reply #2 - Jul 10th, 2007 at 4:06pm
Print Post Print Post  
Hello Erika!

I would like to thank you for  the prompt answer.
But I do not believe I understand you correctly. I mean I can only openly
forms close or? 
Into which practicable situation can one use such Formexit()?

Thanks.
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: FormExit()
Reply #3 - Jul 10th, 2007 at 5:38pm
Print Post Print Post  
Quote:
Into which practicable situation can one use such Formexit()?

It is there to meet an automation request we had from consultants who wanted to open a different form, then close the one they had previously been on.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: FormExit()
Reply #4 - Jul 10th, 2007 at 5:48pm
Print Post Print Post  
Quote:
Hi-
I want to use Formexit() to close the form and go back to the Main Menu.  



There is more to it then just a command, I think it depends on how you open your form and if you have a default form set as a menu.

I have a menu form set as a default and this code on a Save and exit button on my form payment. Hope this steers you in the right direction.

/*
Saves the record and then Exits current mode to the Menu
This works whether adding or searching records because both Menu Tree items are covered
*/

var vNav as Int


If @Mode() = 1
{
     FormCommit("payments")
     vNav = @SelectTreeItem("Search Update Menu!Navigation!Save Record")
     @exit
}

If @Mode() = 0
{
     FormCommit("payments")
     vNav = @SelectTreeItem("Add Data Menu!Navigation!Save Record")
     @exit
}
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: FormExit()
Reply #5 - Jul 10th, 2007 at 8:53pm
Print Post Print Post  
Hello Bob,

that´s what i was looking vor and thank you very much for helping me.
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: FormExit()
Reply #6 - Jul 10th, 2007 at 9:43pm
Print Post Print Post  
Just to clarify  in the code above FormCommit("payments") is actually saving  data on the subform payments that is on the form payment before saving and closing the actual payment form its on. So if you do not have a subform you do not need this.

Also in the newer release of Sesame the documentation explains FormCommit("”)

Calling this command causes the open record in the named form to be committed (saved). Only the open (selected) record in the specified form is saved. In an application with subforms, this command should be used in place of an @SelectTreeItem("Add Data Menu!Navigation!Save Record") command. If the form
name is left blank("") the action will take place on the form from which the command is run.

In the case of subforms, this command will commit the subform record, but does not save (link) it to the parent record. The parent record must be saved independently.

In the case of a parent record, all previously committed subforms will be linked to the parent and the parent form will be committed.

Examples:


FormCommit("Countries")
FormCommit("")      
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: FormExit()
Reply #7 - Jul 11th, 2007 at 12:35am
Print Post Print Post  
Robert,

I believe (and I hope Erika, Mark, or Ray will chime in here to confirm or dispute) that if you use FormCommit on the parent, it is supposed to do the same thing as pressing F10; which will save any uncommitted subrecords and link them to the parent, just before saving the parent.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: FormExit()
Reply #8 - Jul 11th, 2007 at 2:43am
Print Post Print Post  
Quote:
Robert,

I believe (and I hope Erika, Mark, or Ray will chime in here to confirm or dispute) that if you use FormCommit on the parent, it is supposed to do the same thing as pressing F10; which will save any uncommitted subrecords and link them to the parent, just before saving the parent.


Close enough. It actually commits the parent before the children, so if new, there is a parent on the engine side on to which to attach the children.

I think.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged