(Solved) – What does the OpenRecordset method return? [duplicate]

(solved)-–-what-does-the-openrecordset-method-return?-[duplicate]

This question already has an answer here:

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

Leave a Reply

Your email address will not be published. Required fields are marked *