Page Index Toggle Pages: [1] 2  Send Topic Send Topic Print Print
Hot Topic (More than 10 Replies) Save and Close Record (Read 2295 times)
CraigM
Member
*
Offline


No personal text

Posts: 1
Joined: Mar 30th, 2004
Save and Close Record
Mar 30th, 2004 at 9:36pm
Print Post Print Post  
I would like to write a code to Save a record and Close the form...Shift-F10.  Can anyone tell me how to do this.  Thanks
  
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Save and Close Record
Reply #1 - Mar 30th, 2004 at 10:56pm
Print Post Print Post  
Putting a command button on the form and using @selectTreeItem should do what you want to do.
  
Back to top
 
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Save and Close Record
Reply #2 - Mar 31st, 2004 at 3:27am
Print Post Print Post  
How would you exit WITHOUT saving? I would like a button that ABORTS the record and returns them to a selectree item. not just the tree itself.

Can I use the @selecttreeitem command without saving the record?

Using @exit only returns the user to the tree, but I am trying to avoid usering having to navigate through the tree. Its too complicated for them.

Thanks,
Steve
  
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Save and Close Record
Reply #3 - Apr 14th, 2004 at 10:04pm
Print Post Print Post  
Any thoughts on how to use the Selectreeitem command WITHOUT saving the record that is being abandoned?

Good if a user needs to "abort" back to their "customized main menu".

Thanks,
Steve
  
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Save and Close Record
Reply #4 - Apr 14th, 2004 at 11:02pm
Print Post Print Post  
Steve, I believe you have made a custom menu in add mode of a form. Is that right?  I have not done it but it seems, it is do-able using @SelectreeItem( ). If you look in the edit menu, there is an item to "undo Current Form" (Shift F7), then in Navigation Menu there is command "Close Form without saving".    Usually the problem is the flag (warning window) and this will get rid of the flag. Having a button on the form with proper @selecttreeitem( ) code, you should be able close your form without saving that is equivalent to abort.  Now form being closed, you will not be able to open the custom menu form throgh the code on button...but I believe your custom menu form must be open and that is how you opened up the other form you were working on that you closed using command button and just you have to click on the tab to have focus of the open custom menu form.

All this is theoretical and you might encounter many problems along the way.
  
Back to top
 
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Save and Close Record
Reply #5 - Apr 15th, 2004 at 1:45am
Print Post Print Post  
Yes I have a custom Menu that is used in Add mode, but all LE's are unbound and all buttons on the menu are selectreeitem buttons. When presses, these will (save and ) close the menu and go to my database files in either add or search mode, depending on the button being pressed. I just want the user to be able to abort the form they are adding in and return to the menu if needed.

I'll keep looking.

Thanks for your suggestions

Steve in Texas
  
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Save and Close Record
Reply #6 - Apr 15th, 2004 at 3:32pm
Print Post Print Post  
Quote:
Yes I have a custom Menu that is used in Add mode, but all LE's are unbound and all buttons on the menu are selectreeitem buttons. When presses, these will (save and ) close the menu and go to my database files in either add or search mode, depending on the button being pressed.


Command Buttons are undbound anyway, and I believe all of them must be command buttons in the custom menu. The last @selectTreeItem ( ) command before closing the menu must be to close the custom menu form. If you remove the last part of the code, the custom menu should remain open and it could be reached by clicking on one of the tabs.  I believe it should serve the purpose.
  
Back to top
 
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Save and Close Record
Reply #7 - Apr 15th, 2004 at 4:10pm
Print Post Print Post  
Good info. I'll have to check it out. I didnt think of keeping the custom menu open and running at all times. Thats a great idea.

Thanks again!

Steve in Texas
  
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Save and Close Record
Reply #8 - Apr 15th, 2004 at 9:46pm
Print Post Print Post  
Steve,
I tried out the above and it works as suggested. The menu does not close. The menu is on Add Data Menu tab.
  
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Save and Close Record
Reply #9 - Apr 16th, 2004 at 7:50am
Print Post Print Post  
How we make a simple thing complicated!!! In order to achieve "Abort" any changes in any form does not need to have @SelectTreeItem ( ).  One just needs to use @exit on the command button.

If you try to use @SelectTreeItem (), it will not close the form, likely because the form closes before the code is completed.
  
Back to top
 
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Save and Close Record
Reply #10 - Apr 16th, 2004 at 12:36pm
Print Post Print Post  
I was under the impression that @exit actually does a save and exit.?!?!

I'll check it out this weekend.

Thanks again for your help, Bharat_Naik

Steve in Texas
  
Back to top
IP Logged
 
aheimdal
Member
*
Offline


No personal text

Posts: 14
Joined: Dec 16th, 2003
Re: Save and Close Record
Reply #11 - Jun 24th, 2004 at 4:52pm
Print Post Print Post  
Steve in Texas

I have been trying to figure out how to make a custom menu work in a similar method as you.  Command buttons and @selecttree. --User always being able to go back to the menu whenever, open up different forms of the database, etc--  Have you gotten any of this to work?  If so would you mind sharing it with me, or giving me some hints?  I'm lost.

Thanks
aheimdal
  
Back to top
 
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Save and Close Record
Reply #12 - Jun 25th, 2004 at 1:07am
Print Post Print Post  
It's been a long time since I worked on that particular app, but I think Bharat taught me that the first form, which is the menu form, does not close when the user selects his first @selectreeitem. Rather, a second form opens ( you can see two tabs at the bottom of the screen).

When the user chooses to close the 2nd form using an @exit program, it simply closes the 2nd form and the first form (the menu form) then becomes visible again.

Let us know how this works out for you.

Steve
  
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Save and Close Record
Reply #13 - Jun 26th, 2004 at 5:00am
Print Post Print Post  
Quote:
Steve in Texas

I have been trying to figure out how to make a custom menu work in a similar method as you.  Command buttons and @selecttree. --User always being able to go back to the menu whenever, open up different forms of the database, etc--  Have you gotten any of this to work?  If so would you mind sharing it with me, or giving me some hints?  I'm lost.

Thanks
aheimdal


Aheimdal,

This works perfectly well and I have been using it. What part do you have problem with? Do you have problem with @selectTreeItem part or the menu screen availability at all times part?

I have put Menu Form with multiple tabs. Tabs can help organizing the buttons and can works as submenu also. It contains only command Buttons and since it is an open form, @macro command can also work eventhough I did not have to use that since I like @SelectTreeItem command better.  I was surprised to see it works in add as well as in search mode. By puttinng NotifyForm (1) - programming code in Form Exit event, you can prevent saving form and creating records in add mode.  Since all command buttons are unbound elements, it should not really matter anyway. Please let us know what will help you to get going.

As such this discussion should go under topic "Creating Custom Menu System in Sesame".

Bharat

  
Back to top
 
IP Logged
 
aheimdal
Member
*
Offline


No personal text

Posts: 14
Joined: Dec 16th, 2003
Re: Save and Close Record
Reply #14 - Jul 7th, 2004 at 2:21pm
Print Post Print Post  
Bharat

Thanks for the input.  I have this working for the most part but have one more thing that is an issue.  I have my Custom Menu form open along with a second form that I am adding data to.  When I close out of the 2nd form instead of going back to the Custom Menu form it goes back to the Application Menu.  Is there a way to not even show the Application Menu all-to-gether.

Thanks,
aheimdal
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send Topic Send Topic Print Print