Link to home
Start Free TrialLog in
Avatar of Cyber-Drugs
Cyber-DrugsFlag for United Kingdom of Great Britain and Northern Ireland

asked on

VBA - Determine last Inserted UID

Hi guys,

I wanted to know if it's possible to run an Insert statement on a table, and then determine what the UID (also the primary key) of that entry is?

Cheers guys!
ASKER CERTIFIED SOLUTION
Avatar of mbizup
mbizup
Flag of Kazakhstan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
How multi user is your database gonna be

if u use a recordset to add (one I prefer to use if u have several fields to add) then once u do AddNew, u get the UID number (if its a autonumber)
Avatar of Cyber-Drugs

ASKER

There will be one whole user of this amazingly big database (excuse the sarcasm :P )

So I can presume Dmax() will be safe?
Yes.  If you wanted to expand, you'd need to do something else.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Cheers guys!