Returning Autonum key

P

Phil Hunt

I am using DAO and MS Access database. After I run a DB.EXECUTE(SQL) to
insert a record, is there a reliable to get back the value of the new
autonumber field (the primary key in this case) immediately ?

Thanks
 
A

Allen Browne

No.

DMax() may work, but for a reliable way, use the AddNew method to add a
value to the Recordset.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top