cTblName = LEFT(THIS.TAG, I - 1) USE Table1 ORDER 2 && You should use the name of the index here, it's clearer IF SEEK(UPPER(cTblName)) REPLACE FLAG WITH This.Value *-- Type mismatch. <- What is the type of the field? It should be Logical ENDIF USEHTH