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
 
Thanks for the post. I am using ADO.Net, will your solution still work?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top