Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using SQL to autofill a subform on AfterUpdate

Status
Not open for further replies.

ClifCamp

Technical User
Jul 24, 2001
23
US
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top