Is there a way of retrieving the last record inserted into a database?
I use the usual sqlstatement INSERT INTO myDeliveries .......
and then use the Execute statement to process the query.
Some background:
When a new record is created in myDeliveries, MS Access auto allocates a unique random +ve or -ve integer for the ID field.
Unfortunately there are instances where a number of records have all the same field values (other than their ID).
I need to distinguish between these records so that I can retrieve the ID of the record that I last created.
eg: I have just created 5 records to which Access allocated the following IDs: -32, 46, 23, 11, -15.
The ID, -15, is the one I want to retrieve since it belongs to the last record I created.
Is there something I can do (other than a schema change)?
I use the usual sqlstatement INSERT INTO myDeliveries .......
and then use the Execute statement to process the query.
Some background:
When a new record is created in myDeliveries, MS Access auto allocates a unique random +ve or -ve integer for the ID field.
Unfortunately there are instances where a number of records have all the same field values (other than their ID).
I need to distinguish between these records so that I can retrieve the ID of the record that I last created.
eg: I have just created 5 records to which Access allocated the following IDs: -32, 46, 23, 11, -15.
The ID, -15, is the one I want to retrieve since it belongs to the last record I created.
Is there something I can do (other than a schema change)?