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.
 
Top