Full Version: Finding the Primary Key after TransferText
UtterAccess Discussion Forums > Microsoft® Access > Access Q and A
Shane
I am using TransferText to import a text file into a table. When a new record is created, an autonumber is assigned as the primary key. Is there any easy way I find out what this primary key is? In some of my applications I am using random primary keys and so unfortunately it is not as simple as going to the last record.

Thank you for your time

Shane
Shane
I think I have a solution.
I have added a timestamp to the table (DateCreated fiels with default set to now()) after I run the transfertext I select the ID field with the highest timestamp which is less than or equal to now().

This seems to work.

Shane
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.