After 10 or so years of using Access the potential problem of releying on the Autonumber for my tables primary key has become clear. Following a table corrpution I called up a backup, pasted in some records and then realsied that the records did not share the same autonumber as before(Access had jumped the deleted records in the autonumber field). This then made the relationships in my tables loose their integrity.
I have not thought of this issue before and I have commonly constructed tables using an autonumer as my primary key and linked from this. i.e. CustomersID etc...
Access 2010 allows table data macros and so I see that I can have an autonumber at the start of a new record which sets a number field using a table level data macro when an insert event is triggered - (which I can set as primary key).
Would this be a safer and more desirable way of setting a tables primary key? Or if someone has a better suggestion?
Many thanks Mark
I have not thought of this issue before and I have commonly constructed tables using an autonumer as my primary key and linked from this. i.e. CustomersID etc...
Access 2010 allows table data macros and so I see that I can have an autonumber at the start of a new record which sets a number field using a table level data macro when an insert event is triggered - (which I can set as primary key).
Would this be a safer and more desirable way of setting a tables primary key? Or if someone has a better suggestion?
Many thanks Mark