Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Return last record inserted into table

Status
Not open for further replies.

MajP

Technical User
Aug 27, 2005
9,382
US
I have a replicated database where the primary key is an autonumber and random. I have limited access to the backend structure (i.e. adding fields).

So is there a way to determine the last record inserted into a table without an increasing autonumber or date time stamp? Thanks. Thanks in advance.
 


Hi,

A table is like a bag of marbles. Which marble was the last one dropped into the bag? Unless you have a way to tag each marble, like date stamp or highest autonumber.....

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
I am learning that even if you think you will not need it, to put a time stamp in all data tables. The issue was that the original table had an increasing autonmumber but when replicated it becomes random. I will have to get my hands on the design master and enter a time stamp. Thanks.
 
Depends how you're inserting them, and at which point of time you need the number.

If you use SQL, you can retrieve the last autonumber (identity) on the same connection through SELECT @@IDENTITY, see for more details

Roy-Vidar
 
FYI

you can retrieved from access by opening a recordset
 
I don't know enough about your structure, but you might try timestamping users who enter records.
 

How can you retrieve the next autonumber by opening a recordset in Access?

I've tried determining the max value of the autonumber field and adding one, but that doesn't work once I delete some rows.

J
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top