* manually USE the product table ? indexseek ('PutProductIDHere', .t., 'product', 'product_id')Does it find the product?
local lcInvoice_ID, lnCurrentSeason lnInvoice_ID = 31984 && replace this with a valid invoice number && and the correct datatype, of course lnCurrentSeason = 5 activate screen set deleted on Select * from InvoiceDetail Where Invoice_ID = lnInvoice_ID ; into cursor InvLinesCursor <b>? "Records selected: ",_tally select invLinesCursor</b> 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>>