There are 2 problems I can see with your code.
First, the filter go away when the table is closed which happen when you open the Toto table in the same alias as the table Newamar66.
Second, APPEND FROM doesn't support the NEXT clause.
Maybe something like this would work:
USE Newamar66
LOCATE FOR Char21 = THISFORM.Text7.Value
IF NOT FOUND ()
ENDIF
USE Toto IN 0
FOR I = 1 TO THISFORM.Test8.Value
INSERT INTO Toto (<Field list>) VALUES (<Fields from Newamar66>)
CONTINUE
IF NOT FOUND ()
EXIT
ENDIF
ENDFOR
HTH
>i want to add at my table the records have myfield char1="121" and not all of this records just ex.. 100 record randomly from char1="121" ,after that appen new records,change char1 to char1="324" with 150 records randomly etc...
>
>i'll try with this code but i get errors.
>USE newamar66
>SET FILTER TO char21=(thisform.text7.value)
>USE toto
> Append From ('newamar66') next(thisform.text8.Value)