>USE moh11 >COPY TO newmoh111 NEXT (thisform.text1.value) >>thanks.
PROCEDURE rand_insert LPARAMETERS tcSource,tcTarget,tnNumRecs ** tcSource = Alias of Source records ** tcTarget = Name of Target file ** tnNumRecs = Number of random records to copy lnHighVal = RECCOUNT(tcSource) DIME aRandRecs[tnNumRecs] lnInsert = 0 DO WHILE lnInsert < tnNumRecs lnRandNum = IRAND(1,lnHighVal) IF ASCAN(aRandRecs,lnRandNum) = 0 lnInsert = lnInsert + 1 aRandRecs[lnInsert] = lnRandNum ENDIF ENDDO lnCurWa = SELECT() SELECT (tcSource) COPY TO (tcTarget) FOR ASCAN(aRandRecs,RECNO()) <> 0 SELECT (lnCurWa)and place the following code in the command button (I assume) which actually does the work
DO thisform.rand_insert WITH "moh11","newmoh111",thisform.text1.valueFUNCTION irand