local nBarc select barcno && table with barcode number nBarc=barcno.barcno IF nBarc <= 0 MESSAGEBOX("This computer is not setup with barcode numbers","") RETURN ENDIF replace barcno with nBarc+1 &&increase by one FLUSH in barcno force IF USED("barcno") && clos the table USE IN barcno ENDIF IF NOT USED("barcno") && open the table SELECT 0 USE barcno endifAny quick fixes ???