Normal Topic Searching with unexpected results (Read 498 times)
Davidb
Member
*
Offline


No personal text

Posts: 15
Joined: Apr 25th, 2004
Searching with unexpected results
Jun 19th, 2004 at 8:57am
Print Post Print Post  
My application requires that an exisiting form be manually updated once payment for the job has been received.

I retireve only those records that meet the selection criteria (example: All unpaid records).

I then update each record and press F10 to go to the next and so on.

My problem occurs once I get to the last record in the resultset. Instead of pressing F10 and being advised that there are no more records that meet the selection crieria, I am presented with a new BLANK record.

Is this intentional?
Is there a way to prevent moving past the last record in the resultset?

DavidB
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Searching with unexpected results
Reply #1 - Jun 19th, 2004 at 11:01am
Print Post Print Post  
Yes, it is intentional. You can add new records from Update Mode.

To prevent this, here is a snippet of SBasic you can put in the OnFormEnter event.
Code
Select All
If @IsNew
{
  If @Update
  {
    // Retreat to the last existing record
   ResultSetCurrentPosition(@ResultSetTotal() - 1)
  }
}
 


  

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


No personal text

Posts: 15
Joined: Apr 25th, 2004
Re: Searching with unexpected results
Reply #2 - Jun 19th, 2004 at 8:31pm
Print Post Print Post  
Thanks Hammer
I will give this a run.

David
  
Back to top
 
IP Logged