*- The following statement looks redundant. Because *- unless the 'current' table has an index set you will get *- the error message "Table has no index order set." It is also *- missing the RANGE key word. *--- SET KEY TO &lcValue., &lcValue. *- Coded correctly it would look like: USE customer SET ORDER TO postalcode SET KEY TO RANGE '40000', '43999' SELECT book1 index on no tag no && You should only need to do this once && for a table that is not temporary. *- In the following macro substitution is probably not required. *--- lcvalue=[']+UPPER(ALLTRIM(THISFORM.TEXT24.VALUE))+['] *--- SET FILTER TO UPPER(NO)=&lcvalue. *- Instead try: lcvalue= UPPER( ALLTRIM( THISFORM.TEXT24.VALUE )) SET FILTER TO UPPER( NO ) = lcValue LOCATE IF EOF() MESSAGEBOX( "NOT FOUND" ) *- Clear the filter. Set Filter To ELSE THISFORM.GRID4.REFRESH ENDIF *- The following Endif looks redundant. *--- endif