JumpIfBelow
JumpIfBelow

Reputation: 53

How to get the ID of a form new record in Access?

I try to get the ID when I open a form with a new record. So I use this kind of code :

DoCmd.OpenForm "myform", , , , acFormAdd

But when I am in the opened form, how to get the new ID created by Access, as the field is an AutoNumber ?

Upvotes: 0

Views: 3261

Answers (1)

E Mett
E Mett

Reputation: 2302

Once you have started entering the record, the ID will be available using VBA code:

Me.ID

or

Me.<name of control bound to ID field>

Upvotes: 1

Related Questions