>I've a form with a table, and the table have a primary Key, the table is open with buffer mode=5
>When i do a seek Fox preform an automatic tableupdate, and i got an error that the index was violated, because the value i entered in the textfield allready exists.
>What is the best solution for cheking if a value entered allready exists
Support and addition to Rick :
-Never use a user entered key as PK. Use app generated PK. You could generate and use PK in default value (stored procs, insert, update, delete triggers). For single user sys(2015) fits well for PK default value. For multiuser you could add a unique station value to it (ie: sys(0)-Computer name part or netcard physical address).
-To do other type of search and moving rec pointer on a buffered table (or Call another form from a grid while table validation not satisfied etc):
a) Save recno() + current rec contents (ie: scatter to array savearray memo)
b) Fill the record with dummy valid data
c) Use scan...endscan (with recno() check to see if it's your record)
d) Goto org recno() and gather
PS: SQL or use again would return incorrect (I mean recs in buffer wouldn't be taken into account) data for a buffered table.
Cetin