LOCAL nselect nselect = SELECT() SELECT prodlist IF this.parent.chkexact.value=1 SET NEAR ON SEEK ALLTRIM(this.value) ELSE IF this.parent.cbosearch.value='CODE' LOCATE FOR ALLTRIM(this.value)$prodcode ELSE LOCATE FOR ALLTRIM(this.value)$UPPER(prodesrp) ENDIF ENDIF this.parent.grdproduct.setfocus() this.setfocus() SET NEAR OFF SELECT (nselect)and the only code in the grid itself or its contents is this in AfterRowColChange:
LPARAMETERS nColIndex ThisForm.AllowDelete()I'm actually inclined to think the issue is related to the AfterRowColChange code because I added that fairly recently and the problem is new and also because it happens on arrowing, not just on searches. Here's the code in AllowDelete:
* Modified 25-May-2022 by TEG * If this product is in use, disable the Delete button LOCAL iKey, lAllowDelete iKey = ProdList.Key lAllowDelete = .T. SELECT ProdKey ; FROM Detail ; WHERE ProdKey = m.iKey ; INTO CURSOR csrMatches IF _TALLY > 0 lAllowDelete = .F. ENDIF IF m.lAllowDelete * Now check Archive SELECT ProdKey ; FROM Archive ; WHERE ProdKey = m.iKey ; INTO CURSOR csrMatches IF _TALLY > 0 lAllowDelete = .F. ENDIF ENDIF ThisForm.Mycommandbutton4.Enabled = m.lAllowDelete RETURNAs for table sizes, the one they're searching in has about 6000 records. The two queried in AllowDelete have a few hundred (Detail) and around 160,000 (Archive). (I didn't design this system where orders are moved into another set of tables after fulfillment, but it works for them, so I'm not changing it.)