Hello all,
I have a database that was somewhat poorly designed. The tables I need to reindex look like this:
Table 1 - Products
------------------
Key Name Description
Table 2 - Product Items
-----------------------
Key Product_Key Item_Name Etc.
Product_Key is a foreign key to the primary key of table 1. The Product_Key is a simple integer number that corresponds to the position of the record in the database. For instance, the first record should have a key of 1, the second a key of 2, etc. (This sequential numbering is not essential, by the way, everything works fine with gaps in between).
Problem is, as records were deleted from the database, the numbers didn't change, so there are large gaps in the number system. For instance, the first record in Table 1 has a key of 23. I am rewriting the program that uses these tables, I am wondering if there is a function in Access that will let me reindex all of the records but maintain the foreign key relationship? For example, the reindex process would take my primary key of 23 and make it 1, but it would also change all of the foreign keys in the second table from 23 to 1.
Any help would be appreciated,
-Ade
I have a database that was somewhat poorly designed. The tables I need to reindex look like this:
Table 1 - Products
------------------
Key Name Description
Table 2 - Product Items
-----------------------
Key Product_Key Item_Name Etc.
Product_Key is a foreign key to the primary key of table 1. The Product_Key is a simple integer number that corresponds to the position of the record in the database. For instance, the first record should have a key of 1, the second a key of 2, etc. (This sequential numbering is not essential, by the way, everything works fine with gaps in between).
Problem is, as records were deleted from the database, the numbers didn't change, so there are large gaps in the number system. For instance, the first record in Table 1 has a key of 23. I am rewriting the program that uses these tables, I am wondering if there is a function in Access that will let me reindex all of the records but maintain the foreign key relationship? For example, the reindex process would take my primary key of 23 and make it 1, but it would also change all of the foreign keys in the second table from 23 to 1.
Any help would be appreciated,
-Ade