I have a form that gets employee information and I want to enter that information into 2 seperate tables. The name, email, password, etc goes into the employees table and the job title and picture go into the supervisors table. When the info is inserted into the employees table an empID is generated by an autonumber. I want to insert the empID from the employees table and the job title and sup picture into the supervisors table and can't get it to work. Below is what I have to enter the info into the employees table. This part works.
strSQL = "SELECT employees.empFName, employees.empLName, employees.empWkPhone, employees.empHPhone, employees.empEmail, employees.username, employees.password, employees.groupID, employees.venueID FROM employees"
'set cursor type so we can move through the recordset
rsSchedules.CursorType=2
'lock the recordset
rsSchedules.LockType=3
'open connection
rsSchedules.Open strSQL, adoCon
'Tell the recordset we are adding a new record
rsSchedules.AddNew
'Add records to the recordset
rsSchedules.Fields("empFName") = request.Form("Fname")
rsSchedules.Fields("empLName") = request.Form("Lname")
rsSchedules.Fields("empHPhone") = request.Form("Hphone")
rsSchedules.Fields("empWkPhone") = request.Form("wKPhone")
rsSchedules.Fields("empEmail") = request.Form("email")
rsSchedules.Fields("username") = request.Form("username")
rsSchedules.Fields("password") = request.Form("pass")
rsSchedules.Fields("groupID") = 2
rsSchedules.Update
rsSchedules.Requery
Now I can't figure out how to find out what the empID is and then insert it and the other into into the supervisors table. I would appreciate any help.
Thanks,
Judo2000
Edited by judo2000