tblStudentAdvisors has just two fields..."StudentID" & "AdvisorID"
a student can have up to two advisors, or two records in this table ...an advisor can have unlimited students
The "StudentID" is the primary key for tblStudents and "AdvisorID" is the primary key of tblAdvisors
furthermore, if it helps any...here is the code that i have so far that populates the two comboboxes with the current advisors for each student
Code:
'clear textboxes
Me.cboAdvisor1.Value = ""
Me.cboAdvisor2.Value = ""
'declare variables
Dim advisor1 As String
Dim advisor2 As String
Dim strSQL As String
Dim rst As Recordset
strSQL = "SELECT tblStudentAdvisors.*, tblFaculty.firstName, tblFaculty.LastName, tblFaculty.OfficePhone, tblFaculty.OfficeEmail, tblStudentAdvisors.studentID " & _
"FROM tblFaculty INNER JOIN tblStudentAdvisors ON tblFaculty.FacultyID = tblStudentAdvisors.FacultyID " & _
"WHERE tblStudentAdvisors.studentID = " & ID & ";"
advisor1 = ""
advisor2 = ""
'display the results
Set rst = CurrentDb.OpenRecordset(strSQL, dbOpenSnapshot)
If rst.RecordCount > 0 Then
rst.MoveFirst
Do While Not rst.EOF
If IsNull(advisor1) Or advisor1 = "" Then
advisor1 = rst("lastName") & ", " & rst("firstName")
Else
advisor2 = rst("lastName") & ", " & rst("firstName")
End If
rst.MoveNext
Loop
Me.cboAdvisor1.Value = advisor1
Me.cboAdvisor2.Value = advisor2
End If
'Close and empty recordset
rst.Close
Set rst = Nothing