>>>I found that adding this line loses current row in grid:
>>>first row becomes current row always.
>>>I added the recno() save and restore:
>>>
>>>
>>>nr = RECNO()
>>>with thisform.GridBase1
>>> .RecordSource = .RecordSource
>>> .setfocus()
>>>endwith
>>>BROWSE TITLE TRANSFORM(nr) FIELDS rno=RECNO()
>>>GO (nr)
>>>
>>>
>>>I got an error "Record is out of range" in the
>>>GO (nr) line.
>>>
>>>BROWSE command shows -1 in title and also shows that a record having recno() -1 exists.
>>>
>>>Any ideas why GO (nr) fails ?
>>
>>As Fred said it sounds like you're not getting recno() of intended alias.
>
>Cetin,
>
>I tried the following code:
>
>
>LOCAL nRecno
>nRecno = RECNO('mitteakt')
>WITH _screen.Activeform.gridbase1
> * this causes a row to appear in grid:
> .recordsource = .recordsource
>ENDWITH
>SELECT mitteakt
>
>* this works but I caanot use this since tables are large and
>* this takes a lot of time :
>LOCATE FOR RECNO()=-1
>
>* This causes error record is out of range !
>GO (m.nRecno) in mitteakt
>
>
>Why the GO (m.nRecno) in mitteakt fails ?
>
>How to replace this LOCATE command with faster command in large tables without indexes ?
Andrus,
Your code as I remember was some wizard code very hard to follow.
Why would you try to go recno() you're already on. Possibly in your code there is something causing a commit and making recno() positive (row buffered and rec pointer move causing implicit update ?). If -1 is nonexistant then all is committed. Try :
go reccount('mitteakt') in 'mitteakt'
Also possibly locate for recno()=-1 is actually failing and going to eof(). Grid gets you back to last record.
Cetin