Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access/SQL Server retrieving newly created ID

Status
Not open for further replies.

kena1921

Programmer
Oct 26, 2008
9
GB
Hi

I have an Access form bound to a SQL Server table. When a new record is created on the form I need to retrieve the newly created ID from the underlying table - what is the best way of doing this?

Ideally it would be useful to have the ID appear on the from as soon as the user starts entering data (ie in the same way as it would if the form was bound to an Access form)

Cheers
Ken

ps wasn't sure whether this should go in Access or SQL forums
 
Have a look at @@Identity

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I thought @@identity would was probaly it but how would I use this in a practical example - particularly getting the ID to display on a form before it is closed?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top