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

Entering data into multiple tables problem

Status
Not open for further replies.

jakeisstoked

Technical User
May 9, 2003
28
AU
Ok, i know how to enter data into multiple tables with the one form, but my problem is hard to explain. I have 3 tables, one acts as a linking table because i need a many to many type of link. When i enter the data into 2 of the tables, at the same time in the link table need to enter the 2 primary keys (autonumbers) that where just entered into the other to tables, thus linking the records. I guess i need to retrive the last record that was entered so i can enter them in the link table.
Thanks for any help,
Jake
 
SQL Server DB, use a SELECT @@identity after you make the inserts and store the auto #'s in var's until you are ready to insert into the final table

If this is jet then you can use @@identity in 2000 I think but a fail safe is the max() fucntion on the autonumber field



_____________________________________________________________________
onpnt2.gif

Hakuna matata!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top