I have two tables like this
First Tasble
colID | Col1 | Col..
Second table
ColID | ColIDFirstTable | Col..
I want that when I click a button first to insert in First table from my form, and after inserting in first table to take the ID of first table that is primary key and to insert in the second table in second column. Something like this
CurrentDb.Execute " INSERT INTO FirstTable(Col2,vol3)" VALUES ('" & Txt1.Value & "', '" &Txt2.Value & "')"
CurrentDb.Execute " INSERT INTO SecondTabkle(Col2,vol3)" VALUES ('" & IDFirstTbale& "', '" &Txt5.Value & "')"
But I Don't know how to take the ID from First Table and to insert in second Table..
Thanx in advance