>Select Yourtable >lResult=.f. >nTags=tagcount() >IF nTags=0 > =messagebox("No Tags at All") > return >ENDIF >For nLoop=1 to nTags > IF TAG(nLoop)=="SORTTEMP" > lResult=.t. > EXIT > ENDIF >Endfor >IF lResult=.f. > =messagebox("Tag not found") >ELSE > =messagebox("Tag found") >ENDIF >thanks Ed - it works great .. :)))