I have the below code which allows a new Faculty member to be added to the table "MasterTable" it also copies the new Faculty member (by keyboard input) to the "Faculty" table. The problem is that I'd like it to also copy the new MasterID number generated in the MasterTable (Autonum) to the Faculty table. Any idea how?
Public Function Faculty()
Dim strInput As String
Dim db As DAO.Database
Dim rst1stTable As DAO.Recordset
Dim rst2ndTable As DAO.Recordset
Dim rst3rdTable As DAO.Recordset
strInput = InputBox("Add New Faculty Member - (Last Name, First Name MI.)")
If IsNull(strInput) Or strInput = "" Then Exit Function
Set db = CurrentDb
Set rst1stTable = db.OpenRecordset("MasterTable")
rst1stTable.AddNew
rst1stTable.Fields("Name") = strInput
rst1stTable.Update
Set rst2ndTable = db.OpenRecordset("Faculty")
rst2ndTable.AddNew
rst2ndTable.Fields("Name") = strInput
rst2ndTable.Update
rst1stTable.Close
rst2ndTable.Close
End Function
Public Function Faculty()
Dim strInput As String
Dim db As DAO.Database
Dim rst1stTable As DAO.Recordset
Dim rst2ndTable As DAO.Recordset
Dim rst3rdTable As DAO.Recordset
strInput = InputBox("Add New Faculty Member - (Last Name, First Name MI.)")
If IsNull(strInput) Or strInput = "" Then Exit Function
Set db = CurrentDb
Set rst1stTable = db.OpenRecordset("MasterTable")
rst1stTable.AddNew
rst1stTable.Fields("Name") = strInput
rst1stTable.Update
Set rst2ndTable = db.OpenRecordset("Faculty")
rst2ndTable.AddNew
rst2ndTable.Fields("Name") = strInput
rst2ndTable.Update
rst1stTable.Close
rst2ndTable.Close
End Function