Oct 15, 2002 #1 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
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
Oct 15, 2002 #2 KenReay Programmer Aug 15, 2002 5,424 GB 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 Upvote 0 Downvote
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