View Full Version : capture autonumber id after insert


bayman
10-07-2003, 03:37 PM
I'm creating a new row in a table with via the AddNew method, where the table ID is an Autonumber field. I want to capture the value of the ID after I create the row. There are no other unique indices in the table. Can I do this?

Thanks in advance.

Pat Hartman
10-07-2003, 06:24 PM
As long as the autonumber is selected in the recordsource used for the .AddNew, just reference it before you move the record pointer off the inserted record.

SaveAutonumber = rst!YourAutoKey