Processes in Microsoft 365 for setting up Office apps, redeeming product keys, and activating licenses.
It would depend on how you enter the record, but generally, if you use:
lngPK = DMAX("[pk]","tablename")
where pk is the name of your autonumber field, that should return the last PK entered. Assuming you do this immediately after inserting the record in the table.
Hope this helps, Scott<> P.S. Please post a response to let us know whether our answer helped or not. Microsoft Access MVP 2009 Author: Microsoft Office Access 2007 VBA Technical Editor for: Special Edition Using Microsoft Access 2007 and Access 2007 Forms, Reports and Queries