>What and where would you put to maintain the unique ID's when adding a record?
>
>Do you use a Primary index to maintain uniqueness?
>
>Thanks
John,
In the Default Value of the ID field I put the code
GenerateID("Mytable", "MyIndex") which calls a function GenerateID(). This function is kept in the same folder as the tables, although it COULD be added to the Stored Procedures.
The function loads an ID table, looks for a record for 'MyTable' and defaults to the index 'MyIndex'. The record is locked, a value is incremented and the new value is used as the ID. With record locking I can be sure that only one user gets the next ID.
And yes, this is always a Primary index.
HTH
Barbara