Please bear with me as I am new to Visual Basic. I'm using Visual Studio to develop a Windows application. The database I am connecting to is MS Access. I can successfully add new records to the database. What I now need to do is each time I add a new employee to the database, I want to retrieve the unique id (ID autonumber) from the just added record so I can use it to add a "History" record to another table that maps back to the new employee. I will be adding a lot of employees so I want to wait until all of the employees have been added to the dataset before I update the physical database using the following code: Me.EmployeeTableAdapter.Up
What I need is the code that will retrieve the unique id generated from the Me.HWDataSet.Employee.Rows
Any help would be greatly appreciated!
Dim EmployeeRow As HWDataSet.EmployeeRow
' Insert Employee into dataset
Catch ex As Exception