Adding addional ID (key field) to an existing table
I need to add additiona unique ID field to an existing table wich already includes about 500 records.
How would I go about that?
Do you mean the table has no UniqueID field at present, and you want to add one?
One way would be:
- Create the IDField
- Place it on a layout
- Find all records
- Click in the field and choose 'Records -> Replace Field Contents'
- Choose 'Replace with Serial Numbers'
- Go into layout mode and remove access to the field in Browse mode. Or remove the field from the layout. That locks up the work you've just done.
- Check the last ID number that was generated.
- Go to Define Fields, pick up that field, and set it to Auto-enter a serial number. Set the Next Value to be... the next value.
Or just define the field from the start as an auto-entered serial number and let Replace Field Contents update the next serial value setting automatically when you assign your serial numbers to the existing records.
Retrieving data ...