If This.llunique = .T. Set exact on if SEEK(this.value,this.lctablethis.lcindex,) =Messagebox("&lcvalue allready exist on the table",16,"Opps...") NODEFAULT && this will keep focus in the texbox Endif Set exact off Endif>...but I think it should be in the Valid event of the textbox if you want to keep the focus on the textbox.