Hi Naomi.
The Update stuff just replaces about 5 fields as:
Goto Cur.MyRecnum
Replace MyTable.Field1 with Cur.Field1
Replace MyTable.Field2 with Cur.Field2
I think what I'll do is re-engineer the code slightly and use a Primary Key
instead of the record No as the Link
I just cannot see what is going wrong
Unfortunately, I will not know if this has worked or not for a couple of weeks
Thanks a lot for all assistance from everybody
Regards,
Gerard
>BTW, Neil's comment
>
>DO WHILE OT EOF()
>
>Should be DO WHILE NOT EOF()
>
>I would change the DO WHILE with SCAN/ENDSCAN - less lines to code and easier to manage, IMHO.
>
>What exactly is your UPDATE STUFF ?
>
>>Hi Naomi.. thnaks for your reply.
>>Just got used to Do While.. nothing more
>>What seems to be happening is that in my while loop, its updating the First record
>> instead of the last record , sometimes only.
>>
>>Regards,
>>Gerard
>>
>>
>>>>Hi.
>>>>Has anybody had any problems with GOTO recnum. I have an app which seems to fail on this
>>>> intermittently and cant see any reason for it.
>>>>My code is as follows:
>>>
>>>>Select Recno() as MyRecnum,Field1,Field2 from MyTable Into Cursor Cur Readwrite
>>>>Do stuff with Cur
>>>>Sele Cur
>>>>Goto top
>>>>DO WHILE OT EOF()
>>>> If Condition met
>>>> Sele MyTable
>>>> Goto Cur.MyRecnum
>>>> Update Stuff
>>>> Endif
>>>>
>>>> Sele Cur
>>>> Skip
>>>>Enddo
>>>>
>>>>What seems to be happening, again infrequently , but I cannot see a pattern,
>>>> is that the last record in MyTable is updated instead of the MyRecnum record
>>>>
>>>>Any ideas on this would be appreciated
>>>>Regards.
>>>>Gerard
>>>
>>>Why you're not using SCAN/ENDSCAN and is your UPDATE stuff is really a replace command with
>>>
>>>replace ... IN myTable ?
>>>
>>>Finally, I always check with this
>>>
>>>if between(lnRecno, 1, reccount('myTable'))
>>> goto lnRecno in myTable
>>>endif
>>>
>>>just in case