>My table is new, and don´t have anything.
>
>and I consider 3 fields to determine if the record is repeated.
>
>Thanks
>CB
Hilmar provided you the code to check table for existing duplicates.
If you want to prevent insertion of duplicate records there are two approaches I can think of:
1. Create a candidate index on these 3 fields: (assuming all three of them are character):
index on field1 + field2 + field3 tag NoDups candidate
Then you would have to trap the error on the insert (or tableupdate).
Another way would be to check from the interface, e.g. assuming
lcField1, lcField2, lcField3 entered values, you may try
select myTable
locate for field1 == m.lcField1 and field2 == m.lcField2 and field3 = m.lcField3
if found()
endif
However, it may not work correctly in multi-user environment, so the first approach (candidate index) would be better.
If it's not broken, fix it until it is.
My Blog