>ccommand = 'COPY TO ' + cfilename + ' FOR ' + THIS.cflagfield
>&ccommand
>
>SELECT 0
>USE (cfilename) ALIAS tmp1
>ccommand = 'SELECT *,RECNO(ctblname) AS flagrecno FROM tmp1,' + ;
> ctblname + ' WHERE tmp1.' + THIS.ckeyfield + '=' + ctblname + ;
> '.' + THIS.ckeyfield + ' AND tmp1.'+ THIS.cseqfield + '=' + ;
> ctblname + '.' + THIS.cseqfield + ;
> ' INTO CURSOR mycursor'
>&ccommand
>
>I have these commands to select records that are flagged from the buffer (table buffering mode). The RECNO doesn't seem to return the correct number. What is the problem and any idea how to overcome this?
>
>Thanks in advance.
Tai, You're going to have problems whenever you use recno() in a SQL, particularly if you are pulling data from more than one table. The SQL code is not consistent on what record # it uses. You should be using a unique field or combination of fields to get your data.
HTH
Barbara