Is this possible in Access?

  • Thread starter Thread starter Tim
  • Start date Start date
T

Tim

Hi,

Does Access 2002 having anything similiar to "return SCOPE_IDENTITY()"? I
am inserting a record and want to return the ID (autonumber field) of that
record. If not how can I accomplish this?

Thanks in advance
 
Yes....assuming you are inserting the record through code. You just need to
assign the ID field to a variable before doing the update, i.e.,

With x
.AddNew
.Fields("whatever") = varValue
varID = .fields("ID")
.Update
End With
 
Back
Top