Populating Combo box not working

M

Meagan

Hi. I am hoping someone can help.
I have a student form that is tracking progress in graduate programs within
our dept. On this form there need to be fields to enter faculty members who
are on the student's graduate committee. Rather than enter a faculty member
multiple times for each student on whose committee they may serve, I want to
populate a combo box so that a faculty table will be built when new names
are entered. I have a faculty form that will pop up on hitting a button on
the student form, and on this form the user adds the new faculty member. I
have a few problems. After inputting the new member's name (I am using
autonumber for faculty ID since ID will not be known for each faculty), the
user hits a button to save the record. I implement the following code, but
the form stays on record #1 and nothing appears to be saved in the form.:
Option Compare Database
Option Explicit

Private Sub Form_Load()
If Me.OpenArgs = "GotoNew" And Not IsNull(Me![FacultyID]) Then
DoCmd.DoMenuItem acFormBar, 3, 0, , acMenuVer70
End If
End Sub

Private Sub Save_new_entry_Click()
On Error GoTo Err_Save_new_entry_Click

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Exit_Save_new_entry_Click:
Exit Sub

Err_Save_new_entry_Click:
MsgBox Err.Description
Resume Exit_Save_new_entry_Click

End Sub

But, if I go back to the student form, the combo box will have the new
faculty member auto ID, but none of the other information that corresponds
to this newly added member. I do a query on the Student form to show this
information in RowSource of the properties FacultyID combo box:

SELECT Faculty.FacultyID, Faculty.FacultyLast, Faculty.FacultyFirst,
Faculty.FacultyDepartment, Faculty.FacultyEmail, Faculty.FacultyPhone
FROM Faculty;

I would appreciate any help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top