Experts Exchange connects you with the people and services you need so you can get back to work.
Improve company productivity with a Business Account.Sign Up
Dim DB As DAO.Database
Dim RS As DAO.Recordset
Dim lNewID As Long
Set DB = CurrentDb
DB.Execute "INSERT INTO tblSource SELECT Fld1, Fld2, Fld3, Fld4, Fld5 FROM tblSource WHERE ID=5;"
Set RS = DB.OpenRecordset("SELECT @@IDENTITY AS NewID FROM tblSource;")
If RS.RecordCount <> 0 Then
lNewID = RS!NewID
Open in new window
Set RS = Nothing
Set DB = Nothing
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!