Hi -- hoping you can help me avoid a duplication issue in a form I'm creating.
The two tables in question are:
My form, EBP Training, lets users enter details about a course. A subform lets users enter a student's FirstName and LastName.
If the FirstName and LastName are unique, I want to create a new record in tblPeople, and have the ID# from tblPeople to go into tblEnrollment.
However, if the FirstName and LastName already exist in tblPeople, I don't want to create a duplicate record. I want to look up FirstName and LastName in tblPeople, find the ID#, and put it into tblEnrollment. (At this point I'm not worried about two students having the same name. We'll tackle that on a different day.)
Any thoughts on what code I could use to do this? Thanks very much.
The two tables in question are:
- tblPeople -- includes FirstName, LastName, ID# (among other data)
- tblEnrollment -- includes ID# from tblPeople and CourseID#
My form, EBP Training, lets users enter details about a course. A subform lets users enter a student's FirstName and LastName.
If the FirstName and LastName are unique, I want to create a new record in tblPeople, and have the ID# from tblPeople to go into tblEnrollment.
However, if the FirstName and LastName already exist in tblPeople, I don't want to create a duplicate record. I want to look up FirstName and LastName in tblPeople, find the ID#, and put it into tblEnrollment. (At this point I'm not worried about two students having the same name. We'll tackle that on a different day.)
Any thoughts on what code I could use to do this? Thanks very much.