lnCnt = 0 Do while not EOF IF MOD(lnCnt,100) = 0 Doevents() ENDIF write( ) ** here i write a txt file from the records of the table lnCnt = lnCnt + 1 EnddoThis will issue the DoEvents() every 100 times through the loop. BTW, you can change the loop to a SCAN/ENDSCAN and that goes faster too.