Normal Topic retrieve spec programming (Read 538 times)
North_Guy
Member
*
Offline


No personal text, yet.

Posts: 25
Location: Alberta, Canada
Joined: Sep 7th, 2005
retrieve spec programming
Jan 10th, 2006 at 4:20pm
Print Post Print Post  
Just a small problem I'm having that I'm sure someone has run into or can help with. I have an invoice form with a subform that has line items. On retrieve spec, I would like to make it impossible for a user to put search criteria in the subform, other than in the 'spacer' field. I have tried using:

If @mode() = 2 Then
  throwFocus(Spacer)

where spacer is a blank field in the subform. I placed this code in one of the subform fields in On Retieve Spec Open and On Element Entry but it only seems to throwFocus to spacer the first time the subform field is clicked on. I'm sure I'm missing something here.
Any suggestions?
Thanks
  
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: retrieve spec programming
Reply #1 - Jan 10th, 2006 at 4:35pm
Print Post Print Post  
Hello,

When you first enter the Invoice form the focus is going to be on the parent Form, so you will have to click in the subform in order for it to have focus to throw to the spacer element.

If you want to disallow all searches on the subform except in the spacer element, which as I understood in your other post is always blank, why not just hide the subform at the retrieve spec using SubformVisiblity()?

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
North_Guy
Member
*
Offline


No personal text, yet.

Posts: 25
Location: Alberta, Canada
Joined: Sep 7th, 2005
Re: retrieve spec programming
Reply #2 - Jan 10th, 2006 at 5:14pm
Print Post Print Post  
Works like a charm! Thanks Ray.
I was just wondering though, once focus is on the subform, shouldn't throwFocus work on element entry all the time, not just once?
Thanks again.
Don

  
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2480
Joined: Aug 20th, 2003
Re: retrieve spec programming
Reply #3 - Jan 10th, 2006 at 5:29pm
Print Post Print Post  
Hello Don,

Yes and it does, if you are in the right mode. On element entry only fires if you are in Add Data or Update mode, It does not fire in Search mode. There is an exception to that and that exception is command buttons which work in all three modes.

The reason it is working once is because of the same code being in the On Retrieve Spec Open event which is the ThrowFocus that is actually running.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
North_Guy
Member
*
Offline


No personal text, yet.

Posts: 25
Location: Alberta, Canada
Joined: Sep 7th, 2005
Re: retrieve spec programming
Reply #4 - Jan 10th, 2006 at 5:38pm
Print Post Print Post  
Ahhh, I didn't realise that On element entry doesn't work in search mode.
Thanks for your help once again Ray.
Don
  
Back to top
 
IP Logged