local lcInvoice_ID, lnCurrentSeason lnInvoice_ID = InvoiceHeader.invoice_id lnCurrentSeason = 25 activate screen set deleted on Select * from InvoiceDetail Where Invoice_ID = lnInvoice_ID ; into cursor InvLinesCursor ? "Records selected: ",_tally select invLinesCursor scan && we are scanning invLinesCursor, not invoiceDetail table if indexseek (InvLinesCursor.Product_ID, .t., 'product', 'product_id') * product found ? "updating product: ",invLinesCursor.Product_ID select product Replace UseSeason with lnCurrentSeason else * product not found...error processing here * referential integrity is supposed to prevent this ? "Error, product not found: ",invLinesCursor.Product_ID endif endscan