INSERT INTO statement, new record: how to grab autoid number created?

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

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

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

Answers


You can "SELECT @@IDENTITY" from the same DAO.Database object variable where you previously executed your INSERT statement. See here on Stack OverFlow for details.


Need Your Help

Pandas DataFrame aggregate function using multiple columns

python pandas

Is there a way to write an aggregation function as is used in DataFrame.agg method, that would have access to more than one column of the data that is being aggregated? Typical use cases would be

Obj-c Expression error - Invalid operands to binary expression ('CGFloat' (aka 'double’))

ios objective-c expression operands

I have reviewed same types of questions over stack overflow but this is different. Here i want to modulo double value with integer. And compiler is giving below error.