Ruben,
I would recomend that you use queries with cursors instead. Something like
SELECT ... ;
FROM MAIN_TABLE ;
WHERE < Condisions here > ;
INTO CURSOR tempfile READWRITE
REPORT FORM . . . .
USE IN tempfile
Most likely you can do all the data preparation in the query itself so you wouldn't need REPLACE ALL FOR.
>I've got a form with about a dozen radio buttons for executing all of my reports. In the data environment, all the necessary files have been placed.
>
>The intent is to SELECT a table, copy the qualifying records to a file called Tempfile and then report. In abbreviated form, it goes something like this :
>
>SELECT MAIN_TABLE
> COPY TO TEMPFILE FOR . . . . .
>USE
>USE TEMPFILE EXCLUSIVE
> REPLACE ALL FOR . . . .
>REPORT FORM . . . .
>SELECT TEMPFILE
>USE
>
>The problem is that when I click a different Radiobutton for another report, when it gets to "COPY TO TEMPFILE FOR . . . ." I get an error message that the file is already in use.
>
>And by the way, thanks for all your help Serg!
>
>
--sb--