Avoiding duplication in form/subform

SusanCB

Registered User.
Local time
Yesterday, 20:46
Joined
Mar 10, 2010
Messages
34
Hi -- hoping you can help me avoid a duplication issue in a form I'm creating.

The two tables in question are:


  1. tblPeople -- includes FirstName, LastName, ID# (among other data)
  2. 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.
 
Still struggling with this -- can anyone help? Thanks!
 

Users who are viewing this thread

Back
Top Bottom