INSERT INTO Instruction, New Entry: How to create an autooid number?

I have a button click event that takes information from controls and enters it into a table through an INSERT INTO SQL statement in VBA.

I was wondering if there is anything that I could add to this, or any other method to get the record number created for the record?

Can I just turn around and select SELECT against the table and use rs.last?

+4
source share
1 answer

You can "SELECT @@ IDENTITY" from the same DAO.Database object variable where the INSERT statement was previously run. See here in the Stack Overflow section for more details.

+2
source

Source: https://habr.com/ru/post/1305161/


All Articles