This question already has an answer here:
MS Access OpenRecordset query
Using MS Access, when I want to know the ID of the most recently added record, I use
nNewID = CurrentDb.OpenRecordset("SELECT @@IDENTITY")(0)
which I picked up from a posting on StackOverflow.
All the help I have seen for the OpenRecordset method says it returns a recordset object. But my statement above is clearly returning a long. What’s going on?
Thanks for your help