Normal Topic Button to close ADD mode, then open SEARCH? (Read 767 times)
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Button to close ADD mode, then open SEARCH?
Oct 26th, 2007 at 5:17pm
Print Post Print Post  
Is it possible program a command button which, when pressed in ADD mode, will shut down that mode and start up the form in SEARCH mode?  Actually, better yet, would be to program the database so that when ADD mode is opened it loiters for a few seconds, then closes ADD mode, then open SEARCH.  Doable?
  

**
Captain Infinity
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Button to close ADD mode, then open SEARCH?
Reply #1 - Oct 26th, 2007 at 5:55pm
Print Post Print Post  
Ignore that second message (removed); I figured it out.  Had to put my "Hide" before playing with the colors.
  

**
Captain Infinity
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Button to close ADD mode, then open SEARCH?
Reply #2 - Oct 27th, 2007 at 3:57am
Print Post Print Post  
Infinity wrote on Oct 26th, 2007 at 5:17pm:
Actually, better yet, would be to program the database so that when ADD mode is opened it loiters for a few seconds, then closes ADD mode, then open SEARCH.  Doable?

You could try something like the following, but if you have a Startup form set, you will probably end up seeing the Startup form, and need to click on the tab at the bottom of the Sesame window to see the newly opened form in search mode.

Put this in the "Form :: OnFormEntry" event
Code
Select All
Var vSuccess as Int
If @Add
	{
	@Msgbox("NOTICE: You cannot open this form in Add mode.", "",
	"This form will now open in Search/Update mode.")
	@Exit
	vSuccess = @SelectTreeItem(@Application + "!Forms!Search/Update!MyDatabaseName!MyFormName")
	} 

  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
charliebrown
Junior Member
Members
**
Offline


Beware...novice at large

Posts: 97
Location: Sacramento, CA
Joined: Apr 19th, 2006
Re: Button to close ADD mode, then open SEARCH?
Reply #3 - Oct 27th, 2007 at 6:05pm
Print Post Print Post  
Infinity wrote on Oct 26th, 2007 at 5:55pm:
Ignore that second message (removed); I figured it out.  Had to put my "Hide" before playing with the colors.


I'm just having trouble getting someone to look at the tabs at the bottom of the form...I point down at them and they look up  Roll Eyes

btw, you're giving me some great ideas.  Thanks in advance  Smiley
  
Back to top
 
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Button to close ADD mode, then open SEARCH?
Reply #4 - Oct 29th, 2007 at 10:07am
Print Post Print Post  
Thanks Carl, I'll give it a try.  I wasn't sure if any code would run after @Exit was called.

Charlie: why not put the tabs at the top?
  

**
Captain Infinity
Back to top
IP Logged
 
charliebrown
Junior Member
Members
**
Offline


Beware...novice at large

Posts: 97
Location: Sacramento, CA
Joined: Apr 19th, 2006
Re: Button to close ADD mode, then open SEARCH?
Reply #5 - Oct 29th, 2007 at 3:15pm
Print Post Print Post  
Infinity wrote on Oct 29th, 2007 at 10:07am:
Thanks Carl, I'll give it a try.  I wasn't sure if any code would run after @Exit was called.

Charlie: why not put the tabs at the top?


...you know what would happen then, don't you? Grin
  
Back to top
 
IP Logged