I have three forms -- a main form called "frmEveryone" and two other forms, one named "frmEmployee" and "frmStudent." These last two are not subforms.
On the main entry form (frmEveryone) there is a combo box with an event procedure. When you select either "employee" or "student" in the combo box, you are then taken by an event procdure to one of the other two forms -- frmEmployee or frmStudent.
My problem is this:The first time you enter data on an individual and get to the combo box where you choose either "employee" or "student," the event procdure opens an "empty" form. The SSN, Last Name and First Name of the employee do not appear in the form; however, If you go to another employee or close out the form, then reopen, this data appears? How do I make it appear when first opened?
Here is the event procedure I am using with the combo box:
Option Compare Database
Private Sub Classification_AfterUpdate()
If Me.Classification="Employee" Then
DoCmd.OpenForm "frmEmployee,acNormal, ,
"[tblEveryonebio].[SSN]='"& Me.SSN & "'"
Me.Classificaton.Requery
Else
DoCmd.OpenForm "frmStudent", acNormal,,
[tblEveryoneBio}.[SSN}=' " & Me.SSN & "'"
End If
End Sub
On the main entry form (frmEveryone) there is a combo box with an event procedure. When you select either "employee" or "student" in the combo box, you are then taken by an event procdure to one of the other two forms -- frmEmployee or frmStudent.
My problem is this:The first time you enter data on an individual and get to the combo box where you choose either "employee" or "student," the event procdure opens an "empty" form. The SSN, Last Name and First Name of the employee do not appear in the form; however, If you go to another employee or close out the form, then reopen, this data appears? How do I make it appear when first opened?
Here is the event procedure I am using with the combo box:
Option Compare Database
Private Sub Classification_AfterUpdate()
If Me.Classification="Employee" Then
DoCmd.OpenForm "frmEmployee,acNormal, ,
"[tblEveryonebio].[SSN]='"& Me.SSN & "'"
Me.Classificaton.Requery
Else
DoCmd.OpenForm "frmStudent", acNormal,,
[tblEveryoneBio}.[SSN}=' " & Me.SSN & "'"
End If
End Sub