Normal Topic On Application Open (Read 676 times)
SpencerWulwick
Senior Member
Members
*****
Offline



Posts: 677
Location: Wilton Manors, Florida
Joined: Jan 16th, 2005
On Application Open
Sep 6th, 2005 at 5:11pm
Print Post Print Post  
I want to open my application in search mode and have the cursor in a layout element (keyword field) named "Search."

I am using the following code in On Element Open programming:

Code
Select All
var n as Int
n = @SelectTreeItem("Addresses!Forms!Search/Update!Main!FrmAddresses")  



This works just fine and opens my application in search mode.

I assume that I would then use the following code:

Code
Select All
If @mode() = 2 Then ThrowFocus(Search) 



I have tried placing this programming in the element FrmAddresses - On Form Entry and I have also tried placing this programming in the first element on my form (Status) - On Element Entry.  In neither case does it move the cursor to my "Search" element.

What am I doing wrong, please.
  

- Spencer

    ** Practice random kindness & senseless acts of beauty!
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: On Application Open
Reply #1 - Sep 6th, 2005 at 5:37pm
Print Post Print Post  
Try putting it in the OnRetrieveSpecOpen event.
  

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



Posts: 677
Location: Wilton Manors, Florida
Joined: Jan 16th, 2005
Re: On Application Open
Reply #2 - Sep 6th, 2005 at 5:39pm
Print Post Print Post  
Erika -

I forgot to mention that I tried it in that event, also.
  

- Spencer

    ** Practice random kindness & senseless acts of beauty!
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: On Application Open
Reply #3 - Sep 7th, 2005 at 1:04am
Print Post Print Post  
Spencer,

I also tried using ThrowFocus in various events without success.

I ended up using @Macro in the command button programming that is on my custom menu. Try something similar to the following code. The macro simply contains a mouse click on the desired layout element.

Code
Select All
var n as Int
n = @SelectTreeItem("Addresses!Forms!Search/Update!Main!FrmAddresses")
@Macro("Data\Click Keyword LE.mac")
 



BTW, an interesting thing about the macro is that the same macro can work in any database that has a layout element with the same name. So, in some cases, you can use one macro for multiple databases.
  


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



Posts: 677
Location: Wilton Manors, Florida
Joined: Jan 16th, 2005
Re: On Application Open
Reply #4 - Sep 7th, 2005 at 4:34am
Print Post Print Post  
Carl -

A macro call in the Application Program Manager did it; however, I can't believe there wouldn't be an easier way.

Perhaps in version 2?  Perhaps?

Anyhow, thanks Carl -- that takes care of my "need" for now and I've been able to enhance three of my files.  Thank you; thank you!
  

- Spencer

    ** Practice random kindness & senseless acts of beauty!
Back to top
IP Logged