Why you not join files, I am not sure this speed up process but you may try o:)))
SELECT customer.cust_code, customer.fname, customer.lname, stock_code;
FROM customer;
LEFT JOIN Invoice ON customer.cu_recno = invoice.inv_curecno;
LEFT JOIN invlines ON invoice.inv_recno = invlines.invl_invrecno;
Order by customer.cu_recno ;
INTO CURSOR CustStck
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.