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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I retrieve the last Identity value inserted into database?

Status
Not open for further replies.

oricteropo

IS-IT--Management
Mar 7, 2003
29
US
Is there anyway that I can retrieve the last identity column inserted into the database? In SQL Server Selecting the @@Identity variable will return this value but I have not been able to find it's equivalent in Access. Is this even possible?
Thanks in advance
-JK
 
You can generally run a query:
SELECT Max([AutonumberFieldName]) FROM tblYourTable;
Or
DMax("[AutonumberFieldName]","[tblYourTable]")

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
If Access 2000 or greater

On the same connection after the insert do

Select @@identity

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top