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

@@IDENTITY equivalent in VBA ?

Status
Not open for further replies.

sogibear

Programmer
Jul 4, 2002
45
GB
Hello,

Does anyone know of a VBA function that returns the id of a NEW record added in a recordset as soon as it has been added ?

It can be done using @@IDENTITY in a 'Stored Procedure' but i need to use it in VBA.

Thanks
 
Hi

If it is a DAO recordset, then .lastmodified will get you it

eg

With Rs
.Addnew
..etc fill in data
.Update
End With
rs.Bookmark = rs.lastmodified ' position on last interted record Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
kenneth.reaySPAMNOT@talk21.com
remove SPAMNOT to use
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top