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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find Key Value for Just Added record

Status
Not open for further replies.

GreenFella

Programmer
Oct 23, 2001
41
CA
I have an Access application that accesses a SQL Server backend. The application is adding a record to the Customer table. Customer table has a Primary Key of CustID which is also an Identity (auto number) field.

When a new record is added to the table Customer I need to be able to identify the value generated as the CustID so that I can add a record to the CustomerAddress table using the CustID value from the new record as a foreign key.

Does anyone know of a way to capture the newly generated CustID value?

TIA
Stephen
 
Have a look at @@Identity

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top