>USE x2 >*** Index should already exist! >*** INDEX on f4 TO kk > >*** assuming an index on f1 exists! >If Seek(ALLTRIM(thisform.text1.value), "X2", "f1") > local lcFind > Store F4 to lcFind, thisform.text2.value > SELECT f1,f2,f3,f5,f6 FROM x2 WHERE f4=m.lcFind ; > order BY f5; > into CURSOR mycur > > S = _tally && or Reccount() > thisform.grid1.RecordSource="mycur" >ELSE > MESSAGEBOX("not found") >ENDIF >_tally is the ONLY correct way since reccount() may report the total number of records in the table if VFP decides to simply add a filter.