I have the following code:
This works fine and inserts into the basedata table in the database.
Once inserted the table gives the new record an ID number in the ID column. Now I would like to get that ID number from the record that just got inserted and use it in the next line of code.
Is this possible?
Thanks
Swarv
Code:
SQLText = "INSERT INTO BaseData ([lastname], [firstname], [Title], [Department], [EmpTerm], [username], [sec]) SELECT '" & lastname & "', '" & firstname & "', '" & title & "', '" & dept & "', '" & EmpTerm & "', '" & username & "', '" & sec & "'"
DoCmd.RunSQL SQLText
This works fine and inserts into the basedata table in the database.
Once inserted the table gives the new record an ID number in the ID column. Now I would like to get that ID number from the record that just got inserted and use it in the next line of code.
Is this possible?
Thanks
Swarv