Normal Topic F10 KEY IN SEARCH UPDATE MODE (Read 1180 times)
Louis Galvao
Full Member
***
Offline


"Sufferin' Succatash"

Posts: 265
Location: Canada
Joined: Feb 14th, 2005
F10 KEY IN SEARCH UPDATE MODE
Apr 15th, 2005 at 3:14pm
Print Post Print Post  
Why is it that when you are scrolling thru a result set and get to the end, pressing F10 can add a new record inadvertently ?

Is there a way to prevent this ? 

I am finding that if you are not aware of the last record and keep pressing F10 that it creates these blank records.

Thanks,

Louis
  

Louis Galvao
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: F10 KEY IN SEARCH UPDATE MODE
Reply #1 - Apr 15th, 2005 at 3:22pm
Print Post Print Post  
Quote:
Why is it that when you are scrolling thru a result set and get to the end, pressing F10 can add a new record inadvertently ?


This is called Extend mode. It allows you to add a new record onto the end of an existing result set.

Quote:
Is there a way to prevent this ? 

Yes. Use NotifyForm.  There is an example of doing this on page 193 of the 1.1 Programming Gude.

Quote:
I am finding that if you are not aware of the last record and keep pressing F10 that it creates these blank records.

F10 will not commit a blank unchanged record. However, you may have OnFormEntry programming that is changing the form, thereby allowing it to be saved.
  

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


"Sufferin' Succatash"

Posts: 265
Location: Canada
Joined: Feb 14th, 2005
Re: F10 KEY IN SEARCH UPDATE MODE
Reply #2 - Apr 15th, 2005 at 4:19pm
Print Post Print Post  
Thanks for the quick response.

I referred to the programming on page 193 and it has created an error in the existing programming I had setup.  Code as follows:

//Prevents User from adding records in Search/Update mode but allows saving

If @Update Then
{
     If @ResultSetCurrentPosition() = @ResultSetTotal() Then
           {
                 NotifyForm(2)
           }
           Else
           {
                 NotifyForm(-2)
           }
}

//HIDES REPORTS THAT PRINT IMMEDIATELY


var vHideTree as Int


If @Mode() = 1 Then
{
vHideTree = @HideTreeItem("Search Update Menu!Results Commands!Reports!Employee!1 - Report Header Master (print preview)") 
}

Error indicates Statement or end of file expected at the var vHideTree as Int statement. 

The NotifyForm command works very well but now I can't hide the print immediate reports.

Any suggestions ?

PS I do have On Form Entry programming that is changing the records.  I assume this should be used sparingly ?

Thanks,

Louis


  

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


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: F10 KEY IN SEARCH UPDATE MODE
Reply #3 - Apr 15th, 2005 at 4:30pm
Print Post Print Post  
The line var vHideTree as Int, needs to be moved to the first line in your programming. Variable Declarations come before any other programming.

-Ray
  

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


"Sufferin' Succatash"

Posts: 265
Location: Canada
Joined: Feb 14th, 2005
Re: F10 KEY IN SEARCH UPDATE MODE
Reply #4 - Apr 15th, 2005 at 7:21pm
Print Post Print Post  
Thanks Ray.

Louis

  

Louis Galvao
Back to top
 
IP Logged