Thanks for your replies but I'm using dataenvironment object, so when I use the sql statement to open a recordset I must close the recordset object, set the data source property to sql statement and than reopen it after checking the procedure above must be redone so I think all of these stuff decreases the performance

PS: I am using a key field, but I want to check it from code

Thanks