I am trying to autofill a subform with interviewer info from a table based on who logged in. Interviewers fill in the form with the results of their interviews.The code below works but only two fields are appearing initially(FName, LName). This seems strange that only two would appear.(The subform opens with the DataEntry property set to True to limit interviewers to a blank record.) On the subform is a button to open a form containing some information. If I open this and close it, the rest of the autofilled fields appear. Why would only two fields appear initially and what does opening and closing the info form cause? Any help with correcting this weirdness would be greatly appreciated.
Private Sub IntDate_AfterUpdate()
Dim rst As Recordset, strSQL
strSQL = "SELECT * FROM [tblInterviewers] WHERE"
strSQL = strSQL & " [EmplID] = '" & [Forms]![frmPassword]![Text0] & "'"
Set rst = CurrentDb.OpenRecordset(strSQL)
With rst
Me![IntvwrFName] = rst![FName]
Me![IntvwrMI] = rst![MI]
Me![IntvwrLName] = rst![LName]
Me![IntvwrDept] = rst![HomeDepartment]
Me![IntvwrPhone] = rst![WorkPhone]
Me![IntvwrPSID] = rst![EmplID]
End With
rst.Close
DoCmd.GoToControl "Combo93"
End Sub
Private Sub IntDate_AfterUpdate()
Dim rst As Recordset, strSQL
strSQL = "SELECT * FROM [tblInterviewers] WHERE"
strSQL = strSQL & " [EmplID] = '" & [Forms]![frmPassword]![Text0] & "'"
Set rst = CurrentDb.OpenRecordset(strSQL)
With rst
Me![IntvwrFName] = rst![FName]
Me![IntvwrMI] = rst![MI]
Me![IntvwrLName] = rst![LName]
Me![IntvwrDept] = rst![HomeDepartment]
Me![IntvwrPhone] = rst![WorkPhone]
Me![IntvwrPSID] = rst![EmplID]
End With
rst.Close
DoCmd.GoToControl "Combo93"
End Sub