SELECT Temp lnRec = RECNO() lcTyp = alltrim(upper(thisform.grid2.column1.text1.value)) lcMac1 = alltrim(upper(thisform.grid2.column2.text1.value)) select * from temp; where alltrim(upper(temp.typ)) == lcTyp and alltrim(upper(temp.mac1)) == lcMac1; into array laResults SELECT Temp if _tally = 0 append blank in temp replace temp.typ with alltrim(upper(thisformM.text3.value)) go top thisform.grid1.refresh else =mesagebox("found.....") endif GO lnRec && This goes here or in the if statement