In a form, I have a combo box for staff ID which displays staff ID, staff first name, and staff last name, and fills in the last name and first name text boxes as well as the staff ID box based on the selection. I have the following code to do this:
Private Sub cboStaffID_Change()
Me.txtStaffFirstName.Value = Me.cboStaffID.Column(2)
Me.txtStaffLastName.Value = Me.cboStaffID.Column(3)
End Sub
In both the form and the table, the staff ID, first name, and last name all show up correctly in the proper fields.
In the same form, I have a combo box for student ID and two text boxes for student first name and student last name. Though I followed the same steps as I did when doing the above, the results are different. Instead of showing three fields in the selection window (student ID, student first name, student last name as what is similarly output for staff), it only displays two (student first name and student last name). Again, I have similar visual basic code:
Private Sub cboStudentID_Change()
Me.txtStudentFirstName.Value = Me.cboStudentID.Column(6)
Me.txtStudentLastName.Value = Me.cboStudentID.Column(7)
End Sub
When I make a selection, the student first name shows up in the student ID field in the form, though in the table, the student ID is correctly written. In the table, neither the student last name or student first name are written.
Anyone have a clue as to what could be wrong?
Many thanks, Jim
Private Sub cboStaffID_Change()
Me.txtStaffFirstName.Value = Me.cboStaffID.Column(2)
Me.txtStaffLastName.Value = Me.cboStaffID.Column(3)
End Sub
In both the form and the table, the staff ID, first name, and last name all show up correctly in the proper fields.
In the same form, I have a combo box for student ID and two text boxes for student first name and student last name. Though I followed the same steps as I did when doing the above, the results are different. Instead of showing three fields in the selection window (student ID, student first name, student last name as what is similarly output for staff), it only displays two (student first name and student last name). Again, I have similar visual basic code:
Private Sub cboStudentID_Change()
Me.txtStudentFirstName.Value = Me.cboStudentID.Column(6)
Me.txtStudentLastName.Value = Me.cboStudentID.Column(7)
End Sub
When I make a selection, the student first name shows up in the student ID field in the form, though in the table, the student ID is correctly written. In the table, neither the student last name or student first name are written.
Anyone have a clue as to what could be wrong?
Many thanks, Jim